I'm testing something I made and it's not working in game, but it works perfectly in studio.
I'm posting the script, but I mainly want to know what kind of things would cause a script to do this.
I don't really want an edited script (I won't reject it though) I would like a hint or something on where to find my error. I prefer to learn from mistakes rather then have people solve them
tool=script.Parent player = script.Parent.Parent.Parent mouse = player:GetMouse() tool.Activated:connect(function() local clone = game.Lighting.Dummy:Clone() clone.Parent = game.Workspace clone.Torso.CFrame = CFrame.new(mouse.Hit.p + Vector3.new(0, 3, 0)) --Adding Vector3's end)
Accessing the player from the client should be through game.Players.LocalPlayer
. Any script that runs locally on the client is supposed to be a LocalScript. Often times when a script in a tool doesn't work, adding a delay at the beginning solves the problem.