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

Where are a player's positions?

Hello I would like to change the positions of the player when he passes on a button to teleport him somewhere else here is the beginning of my script :

owner = script.Parent.Parent.Parent.Parent.Owner
owned = script.Parent.Parent.Parent.Parent.Owned
boddy = script.Parent.Parent.Parent.Parent.Starter.Dropper1.Union
part = script.Parent.Parent.Parent.Parent.Starter.Dropper1.drop
button = script.Parent.Parent.Parent.Parent.Starter.Dropper1.Button

script.Parent.Touched:Connect(function(hit)
	if owned.Value == true then
		if owner.Value == hit.Parent.Name then
~~			and this is where I would change the player's position
		end
	end
end)

2 comments

0

Player.Character:MoveTo(Vector3 Position)

0

In my script it doesn't recognize "Player", is that normal?

1 answer

✓ Accepted answer

Hello.


Solution:

Use Model:MoveTo(). It will move a model to a Vector3 position.


Recommendations:

  • Put "local" before creating a variable.

Fixed Script:

local owner = script.Parent.Parent.Parent.Parent.Owner
local owned = script.Parent.Parent.Parent.Parent.Owned
local boddy = script.Parent.Parent.Parent.Parent.Starter.Dropper1.Union
local part = script.Parent.Parent.Parent.Parent.Starter.Dropper1.drop
local button = script.Parent.Parent.Parent.Parent.Starter.Dropper1.Button

script.Parent.Touched:Connect(function(hit)
	if owned.Value == true then
		if owner.Value == hit.Parent.Name then
			hit.Parent:MoveTo(Vector3.new(X, Y, Z))
		end
	end
end)

Please accept my answer if it helped.

1 comment

0

thank you

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