How do i make when prompt triggered by player it will teleport another player

i tried using this code
script.Parent.Triggered:Connect(function(player)
if player.Team.Name ~= “Playing” then
if player.IsOnPlaying.Value == true then
local char = player.Character
local humroot = char:WaitForChild(“HumanoidRootPart”)
humroot.CFrame = script.Parent.Parent.Parent.SpawnPlace.CFrame
player.Team = game.Teams.Playing
end
end
end)
so it will teleport another player when IsOnPlaying.Value is equal to tru

The code is teleporting the player that triggered the Prompt not the “another player”. You should specify who is the “another player” was like in what team, and how to choose one in many of them

can i check player team like this? if player.Team.Lobby then

No, it should be if player.Team==Teams.Lobby then

alright thanks bro hope you have a good day!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.