Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to record a player previous position?

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

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 :)

1 comment

0

I made the script but I still dont know how to store their position

This discussion is preserved as it was. New answers, comments, and votes are closed.