Hello can someone help me with that ? I dont know how can i make a script that when a player touch a part all players are teleported to another part . Could someone can help me please ?? For the moment i only have this script
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
– add the teleportation for all users
for _,p in pairs(game.Players:GetPlayers()) do
if p.Character then -- If the Player has a Character
p.Character:MoveTo("Your Position Here") -- Teleports Player
end
end
What this will do is Iterate through every Player (go through every Player) and check if they have a Character, if they don’t, this code will error since the don’t, thats why the if statement checks if the Player does have a Character, If the Requirement is met, it will teleport the Player
local Players = game:GetService("Players")
local AnotherPart = ANOTHERPARTHERE
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) then
for i,v in pairs(Player:GetPlayers()) do
local char = v.Character
if char then
char.HumanoidRootPart.CFrame = AnotherPart.CFrame
end
end
end
end)
How? I just said i was rude that i did something, and someone just did the same thing and that was taken.
Its kinda sad to have that happen where you do something, and someone gets more when they did the same thing.
Nope, That would be a waste of my time.
I would have never gotten 200+ Solutions if thats what I was doing.
People try to get Solutions, Who cares if people like me, that’s not important, I know there are people who do just want Solutions and Likes, but dont Assume that about me