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

How to record a player previous position?

Asked by 3 years ago
Edited 3 years ago

I would like to script a Rewind Attack, I don't know how to record a persons previous position.

edit: uhh I tried this

local remote = game.ReplicatedStorage.Reverse
local DB = false

remote.OnServerEvent:Connect(function(plr)

    game:GetService("Players").PlayerAdded:Connect(function(plr)
        plr.CharacterAdded:Connect(function(char)
            local PrvLoc = char.HumanoidRootPart.CFrame 
            wait(3)
            char.HumanoidRootPart.CFrame = PrvLoc
        end)
    end)    
end)

The only thing I'm having problems with is how to store their position

1 answer

Log in to vote
0
Answered by 3 years ago

When the player uses the attack store their Humanoids position in a variable. Once the attack has finished have them teleported back

You could use the event system to do this and wrap this into a nice little function to keep your code clean!

Have a go at it using information from the wiki, if you're still having problems come back and post what you've tried! (Use the blue lua button when posting to format the code for us :)

0
I made the script but I still dont know how to store their position monsterdanger16 13 — 3y
Ad

Answer this question