Okay guys, I'm making a game and i have a clickable unioned pickaxe, but it requires a server-script to run, but a local-script to add the tool to the player's backpack, The tool is in game.Lighting so it can clone it and add it to the user backpack, please help! --My Code-- ServerScript (game.Workspace.Union.Script)
script.Parent.ClickDetector.MouseHoverEnter:connect(function()
script.Parent.SelectionBox.Transparency = 0.5
end)
script.Parent.ClickDetector.MouseHoverLeave:connect(function()
script.Parent.SelectionBox.Transparency = 1
end)
script.Parent.ClickDetector.MouseClick:connect(function()
--I cannot get the LocalPlayer or anything like that within a server script, which is where i am stuck
end)
LocalScript (game.StarterPack)
pickaxeClicked = game.Workspace.GlobalVars.picaxeclicked
while pickaxeClicked == false do --to keep the code running until pickaxe gets clicked (maybe --thats where i failed? idk)
if pickaxeClicked == true then
pickaxeTool = game.Lighting.Pickaxe:Clone()
pickaxeTool.Parent = game.Players.LocalPlayer.Backpack
end
wait(0.11)
end
So its pretty much just simple code.. but i cant figure out how to get the whole thing to work. Please help.

1 comment
What are you trying to do? WHY isnt that a server script? you can clone it to the player from the serverscript.