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

How to Detect players position before they click a button?

I have a button that teleports a player to a Position in the baseplate when they click it and I want to record the CFrame they were in before they last clicked it.

3 comments

0

In the script,

0

In the script, before the teleporting occurs.

0

save the cframe to a variable

1 answer

✓ Accepted answer

In order to see the current Cframe of the player you must see it before you teleport them

Try placing this inside of your click detector This is a server script

script.Parent.MouseClick:Connect(function(plr)
	local Char = game.Workspace:FindFirstChild(plr.Name)
	local FirstPosition = Char.LowerTorso.CFrame -- This is where the position he was first at was 
	-- local FirstPosition = Char.Torso.CFrame 
	-- use the code above this to use R6
	Char:MoveTo(game.Workspace.Part.Position) -- Put where you want him to move here
	print(FirstPosition) -- this checks if the script is working(you can delete it)

end)

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