So I'm trying to clone a tool from ReplicatedStorage to the players Backpack but it isn't working for some reason. Her'es the script:
script.Parent.ClickDetector.MouseClick:connect(function()
local clone = game.ReplicatedStorage.Pyro:Clone()
local player = game.Players.LocalPlayer
clone.Parent = player.Backpack
end)
I've also tried this:
local player = game.Players.LocalPlayer
local clone = game.ReplicatedStorage.Pyro:Clone()
script.Parent.ClickDetector.MouseClick:connect(function()
clone.Parent = player.Backpack
end)
But none work. Been trying to get this to work since Yesterday, I asked on the ROBLOX forums but no one was giving me a correct solution.
This is in a local script inside a part with a ClickDetector

2 comments
Hint: use a server script
I don't think a local script will work if it's in any game service other than the ones that get put into the players e.g. ScreenGui StarterPack or StarterPlayerScripts... It needs to be a normal script and a local script in screengui that connects with that one to make it work when it's clicked