What do you want to achieve? Make a working button that gives weapons to the user who presses it.
What is the issue? I have errors in my code which I don’t know how to fix
What solutions have you tried so far? I have tried Youtube and the DevForum
My script so far:
local p = game.Players.LocalPlayer
script.Parent.MouseButton1Up:Connect(function()
local tool = script.Parent.Bow:Clone()
tool.parent = p.Backpack
script.Parent.Visible = false
end)
The only problem is that I cant move the weapon from wherever to the players backpack. Please help ASAP Thank you if you read this or helped me solve this.
First of all, since its a local script, the tool wont be visible from the server, which means the tool might have problems when used, you’ll need to tell the server to give the player the tool using remoteEvents.
You’re using a LocalScript, which Is a client side and no one will see this tool. You should add a RemoteEvent and use :FireServer() In a LocalScript and .OnServerEvent() In a Script to make It server side