I made a button that gives player an item. The item is in "ServerStorage" , and I am cloning the item.
local button = script.Parent.Parent script.Parent.MouseClick:connect(function() print("hey") local copy = game.ServerStorage.BlOcK:Clone() copy.Parent = game.Players.Player1.Backpack end)
Model > Button > ClickDetector > Script | ServerStorage > Tool
Player1 is the player I want to give him the item. I dont know how to make it work. Please help. Thank you. :)
Try using this:
script.Parent.MouseClick:connect(function(plr) local copy = game.ServerStorage.BlOcK:Clone() copy.Parent = plr.Backpack end)
So what this does is that it clones the tool to the player who clicks the button. Sorry if I misunderstood your question. P.S Also sorry about the bad indentation, I'm on mobile right now.