![]() ![]() If p ~= nil and p:FindFirstChild("Torso") then P = m.Parent:FindFirstChildOfClass("Humanoid") Therefore your end result code will look something like this: function onTouched(m) Then for changing the teams I would look at Crabway's answer as I don't see any issues with the team changing part. So following all that your teleport line will become: p.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(0,8,9)) Instead you should change the CFrame of a part called "HumanoidRootPart" which is sorted in the character and has the same position as the player's "Torso".Īnother point is that when creating a new CFrame position with only the three co-ordinates you need to convert it from a Vector3. ![]() He will spawn directly on the SpawnLocation of his team and can go directly into the door.īefore I start on the team changer you should note that changing the CFrame of a player's "Torso" will kill them. ![]() Next time this player spawns into the game (after his death). Then he must walk through one of your SpawnLocations, which assigns a team to him (depending which SpawnLocation he steps on). If a new player comes to the game, he will spawn in the center of your room, while he has no team assigned yet. Place these SpawnLocations just in front of your 2 doors, so the player MUST touch them (step on them) before he walks in the door. In your TEAMS folder in Explorer (Roblox Studio Explorer) set for both your teams "AutoAssignable" to FALSE. TeamColor: Blue (set this according to your team color).TeamColor: Red (set this according to your team color).Set properties of first SpawnLocation like this: Place 2 SpawnLocations in your initial room. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |