Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I get this teleport tool to work in playmode?

Asked by 6 years ago

This works in studio, but doesn't in play/server mode. I have tried using normal script AND local script, and no result. How can you get it to work?

Here is the script

repeat wait() until game.Players.LocalPlayer.Character


local plr = game.Players.LocalPlayer
local MyBody = plr.Character
local mouse = plr:GetMouse()
local flash = script.Light
local spark = script.Sparkles

script.Parent.Activated:connect(function()
    local hit = CFrame.new(Vector3.new(-720.8, 20, 35.2))
    script.Use:play()
    spark:Clone()
    spark.Parent = MyBody.Torso
    flash:Clone()
    flash.Parent = MyBody.Torso
    wait(0.2)
    MyBody:MoveTo(hit.p)
    MyBody.Torso.Light:remove()
    MyBody.Torso.Sparkles:remove()
end)
0
Of course the normal script wouldn't work because normal scripts can't get your mouse position or local player. You'll have to have a local script that sends the information to a normal script. Troidit 253 — 6y
0
Use remote events to send the information that the local script gets to a server script Viking359 161 — 6y

Answer this question