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)

1 comment
my problem was that if it was in a local script, it was loading before the player got there so i always used wait(0.5) before it executed the rest of the script