我试图做一个标签游戏,一个球员从观众队或纽科队将被选择为标记,另一个将被选择作为跑步者。他们都将传送到一个小地图,在那里,标签将尝试抓住跑步者在时间之前。现在我的问题是,当球员加载到游戏中时,他没有自动分配给nuturalteam(观众队),而且当球员在地图上切换时,他们不会将球队变成tager和runner,他们都将在同一支球队中。帮助将被学徒!此外,除了"loadstring不可用“之外,我在外部没有任何错误。下面是圆形系统脚本:
Teams = game:GetService("Teams")
local SpectateTeam = game.Teams.Spectate
local ItTeam = game.Teams.It
local RunnerTeam = game.Teams.Runner
local roundlength = 5
local intermissionLength = 4
local inRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local LobbySpawn = workspace.Map.SpawnLobby
local MapSpawnIt = workspace.Map.SpawnMapIt
local MapSpawnRunner = workspace.Map.SpawnMapRunner
local frame = game.StarterGui.ScreenGuimenu.Frame
local KillerSpawn = workspace.Map.SpawnMapIt
local lobbyspace = workspace.Lobbyspace
game.Players.PlayerAdded:Connect(function(player)
player.Team = SpectateTeam
end)
inRound.Changed:Connect(function(player)
if inRound.Value == true then
local chosen = Players:GetChildren()[math.random(1, #Players:GetChildren())]
print(" is It")
chosen.Team = ItTeam
local runner = SpectateTeam:GetPlayers()[math.random(1, #Players:GetChildren())]
print(" is Runner")
runner.Team = Teams.Runner
wait()
runner.Character.HumanoidRootPart.CFrame = MapSpawnRunner.CFrame
chosen.Character.HumanoidRootPart.CFrame = KillerSpawn.CFrame
end
if inRound.Value == false then
for _, player in pairs(game.Players:GetChildren(player)) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
player.Team = SpectateTeam
end
end
end)
local function RoundTimer()
while wait() do
for i = intermissionLength, 0, -1 do
inRound.Value = false
wait(1)
Status.Value = "Intermission:" .. i .."seconds left!"
end
for i = roundlength, 0, -1 do
inRound.Value = true
wait(1)
Status.Value = "Game:" .. i .."seconds left!"
end
end
end
spawn(RoundTimer) ```发布于 2022-10-03 22:06:08
我找到答案了!我只是忘了将团队的颜色与生成的颜色同步:)
https://stackoverflow.com/questions/73934846
复制相似问题