Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How would i make something with character teleportation?

Asked by 3 years ago
Edited 3 years ago

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

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 DeceitVonWrede 0 — 3y

1 answer

Log in to vote
0
Answered by
Games_DBZ -15
3 years ago
Edited 3 years ago

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.

0
Thank you though! i am happy i learned a new way to teleport that is much easier then specific cords. :) TeaWithMee 76 — 3y
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. TeaWithMee 76 — 3y
0
No problem dude :), if you have any problem contact me. Games_DBZ -15 — 3y
Ad

Answer this question