game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
local str = Message
local split = str:split(' ')
local command = split[1]
local user = split[2]
local tool = split[3]
if command == ":give" or command == ":Give" then
if game.ServerStorage:FindFirstChild(tool) then
local Tool = game.ServerStorage:WaitForChild(tool):Clone()
Tool.Parent = game.Players:FindFirstChild(user).Backpack
end
end
end)
end)
If this is what you were searching for please click the “Solution” button next to my post so everyone can know that this post is answered and no longer needed of help assistance.
with help of open ai i made it autofill the user : D
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
local str = Message
local split = str:split(' ')
local command = split[1]
local user = split[2]
local tool = split[3]
if command == "!give" or command == "!Give" then
local playerToGive = nil
for _,p in pairs(game.Players:GetPlayers()) do
if string.sub(p.Name, 1, #user):lower() == user:lower() then
playerToGive = p
break
end
end
if playerToGive and game.ServerStorage:FindFirstChild(tool) then
local Tool = game.ServerStorage:WaitForChild(tool):Clone()
Tool.Parent = playerToGive.Backpack
end
end
end)
end)