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

How would i make something with character teleportation?

Im trying to make a custom character creation set where i have the player click on a button and it would teleport them to a certain position on the map. I understand how to do this like

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.FireClick.OnServerEvent:Connect(function(plr)
		local char = game.Workspace:FindFirstChild(plr.Name)
		wait()
		char.HumanoidRootPart.Position = Vector3.new(-7889.251, -179.843, 452.37)
	end)
	end)

This is correct and all but i only want the player who clicked to be visible when teleported. so if others teleport they are the only ones visible aswell. Something along the lines of that. Thank you so much and i understand if this is hard to read. Please let me know if you need any other info to help! -TeaWithMee

1 comment

0

A weird quirk with characters is that you have to move the whole character, not just the root part (the root part works for the client, but gets glitchy for the server, and the player appears to be in the other spot). Instead, what you wanna do is

1 answer

For your Answer you try to it:

script.Parent.MouseButton1Click:Connect(function()

	
	local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Teleport")
	remoteEvent:FireServer()
end)

second script code : put this other code to Script:

local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Teleport")
local teleportBlock = workspace:FindFirstChild("TeleportPoint")


remoteEvent.OnServerEvent:Connect(function(player)

		workspace[player.Name].HumanoidRootPart.CFrame = teleportBlock.CFrame
	
	end)

make sure the second script to put in ServerScriptService.

And Make block in Workspace and put name TeleportPoint.

Just put this block in the space you want to place and put it in transparency = 1

If that helped you, thank you, if it didn't help, I'm sorry.

3 comments

0

Thank you though! i am happy i learned a new way to teleport that is much easier then specific cords. :)

0

Here is more context: I am trying to make a character customisation scene, i need to have a teleport to a small location on my map where you can change things on your character. so if someone else teleported to the spot they would be able to customise aswell. but they wouldent get in the way of eachother.

0

No problem dude :), if you have any problem contact me.

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