"make me a script where if you say !handto you give the tool your holding to the person you say !handto username"
local Players = game:GetService("Players")
local function onPlayerChatted(player, message)
if message:sub(1, 7) == "!handto " then
local targetName = message:sub(8)
local targetPlayer = Players:FindFirstChild(targetName)
if targetPlayer and targetPlayer.Character then
local tool = player.Character:FindFirstChildWhichIsA("Tool")
if tool then
tool.Parent = targetPlayer.Character
else
player:Kick("You are not holding a tool.")
end
else
player:Kick("Player not found.")
end
end
end
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
onPlayerChatted(player, message)
end)
end)