So I'm currently trying to make a GUI that gives the player the gear they so choose. I thought I found something that worked (script I found in another GUI), but when the player got the tool, it was unusable. I also found out that only the play could see that weapon, not others.
So this is what I found and used:
local p = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() local tool = script.Parent.BlackironKatana:Clone() tool.Parent = p.Backpack end.
Any help on this would be greatly appreciated, once this is out the way, it's off to the fun of making the world :)
I had this same problem, the issue is you are using a local script to try and give them, you need to use a remote event and a server script. Put a remote event in replicated storage called "fire". Put a server script in server script service.
Local script:
script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.fire:FireServer() end)
Server script:
game.ReplicatedStorage.fire.OnServerEvent:Connect(function(player) local tool = script.Parent.BlackironKatana:Clone() -- Modify this to be the directory of the gear, e.g game.ReplicatedStorage.BlackironKatana:Clone() tool.Parent = player.Backpack end)
A Remote Event
is used to send a message from the client to the server or the other way round. In your case, you need to give a message to the server. That message is the fact that the player clicked the button, and now should receive the gear.
If I helped please accept this, if you need any more information on how to use remote event please ask