Im having trouble of thinking of a way to seperate players
If I wanted to teleport 5 players onto these 5 platforms, one on each platform, how would I do it?
Thanks.
Im having trouble of thinking of a way to seperate players
If I wanted to teleport 5 players onto these 5 platforms, one on each platform, how would I do it?
Thanks.
have a table of platforms, iterate the table choose a player, set player position to platform, disable that platform from table, continue with the iterations until filling the 5 platforms, but totally depends on exactly what mechanics you desire
First we have to loop through the players and we need an array of the 5 platforms.
Let’s assume you put the 5 platforms inside a folder (with nothing else inside of them) then we would need to do the following.
local PlayerService = game:GetService("Players")
local PlatformFolder = ...
-- the function:
for i, player in pairs(PlayerService:GetPlayers()) do
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if root then
local platform = PlatformFolder:GetChildren()[i]
if platform then
root.CFrame = platform.CFrame + Vector3.new(0, 3, 0)
else warn("Platform with index " .. tostring(i) .. " was not found!") end
end
end
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.