I am currently wondering why is a LocalScript working perfectly in Studio, but does nothing in the game itself.
The LocalScript itself:
lp = script.Parent
local debounce = false
function onButton1Down(mouse)
if not debounce then
debounce = true
local grenade = game.ServerStorage:WaitForChild("Grenade")
local model = grenade:clone()
model.Parent = game.Workspace
model = game.Workspace:WaitForChild("Grenade")
model.PrimaryPart = model.Union
model:MakeJoints()
model:MoveTo(mouse.hit.p)
local cframe = model.PrimaryPart.CFrame
model:SetPrimaryPartCFrame(cframe * CFrame.fromEulerAnglesXYZ(math.random(0,359), math.random(0,359), math.random(0,359)))
wait(5)
debounce = false
end
end
function onEquipped(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end
lp.Equipped:connect(onEquipped)
The Script is in a Tool and it is supposed to clone a Model called Grenade from ServerStorage to Workspace where the mouse cursor is.
It works without any problems in ROBLOX Studio. However, when I join the game and use the Tool, it does nothing when I click.
As you can see, it is a LocalScript and there is WaitForChild here. It still works perfectly in ROBLOX Studio, but not in the game.
I kindly request your help and advice, fellow scripters.
Thanks.

2 comments
I'd like to know if its FE or Non-fe or Experimental Mode on
Non-FE