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

I tried making a teleport player to coordinates GUI and I got an error?

Here is the code

--Strings
local Playername = game.StarterGui.ScreenGui.Player.Text
local Coordinates = game.StarterGui.ScreenGui.Coordinates.Text
--Script
script.Parent.MouseButton1Click:Connect(function() 
	Playername.HumanoidRootPart.Position = Coordinates
end)

Also here is the UI so you get the point https://gyazo.com/439995b389db1a07c1b06a06a01bc333

And this is the error I received when I attempted to test it https://gyazo.com/4bb4174f24bbc8be9c94b203bbc7d509

7 comments

0

i mean use the Vector3 thingy, try dat

0

But it didn't say anything about the coordinates All it said that it couldn't find my Humanoid Root Part

0

then find the character like ; local player = game.Players.LocalPlayer ,,, local ch = player.Character

0

I need to find any player I type though.

0

u mean a certain player or what

0

I want to make a fill in th blank where it teleports the player I typed so It can't be local player

0

find the character in the workspace

1 answer

✓ Accepted answer

This is because you’re referencing to the Player Object, instead of the Character, your issue should easily be resolved by writing this in your Mouse Event.

script.Parent.MouseButton1Click:Connect(function()
   local Character = workspace[Playername]
   Character:MoveTo(Coordinates).p + Vector3.new(0,3,0)
end)

Hope this helps, don’t forget to accept and upvote! Something wrong? Comment!

I understand :MoveTo() might be new to you, if you’d like to learn more, see this website

4 comments

0

Additionally, you won't be able to change your position in a local script. You'll need to write it into a server script and use remote functions to trigger it in the GUI

0

I tried in cooperating that but I got a different error. https://gyazo.com/e09de7a50803d99a785fbfacb805679f

0

Uhhh I don't know how to use a remote function can you explain?

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