So i'm trying to make a tool where when you activate the tool, it teleports you to where your mouse's cursor is. It's a local script.
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local plrn = plr.Name local plrchr = game.Workspace:WaitForChild(plr.Name, 10000) tping = false script.Parent.Activated:Connect(function() mouse.Button1Down:Connect(function() if tping == false then wait(0.1) tping = true plrchr.HumanoidRootPart.CFrame = mouse.Hit wait(0.25) tping = false end end) end)
Can someone help me with this?
The script works fine for me when I inserted it into a LocalScript inside of a tool. Make sure the tool has "RequiresHandle" set to false