Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[CLOSED] Checking the team of a player how?

Asked by
Creacoz 210 Moderation Voter
5 years ago
Edited 5 years ago

So I don't know why it doesn't check the player's team , "player" is well assigned

event.OnServerEvent:Connect(function(player, request)
    if request == "Starting" and player.Team == game.Teams.Host then
        event:FireAllClients("Startit")
    end
end)

1 answer

Log in to vote
0
Answered by
Arkrei 389 Moderation Voter
5 years ago
local Teams = game:GetService("Teams")

if player.Team == Teams.Host then
    --code
end
0
Didn't work Creacoz 210 — 5y
0
print(player.Name) returns my name Creacoz 210 — 5y
0
the only thing i can think of then is that in your if statement "request" isnt "Starting" Arkrei 389 — 5y
0
It is, I checked without the player team thing and it works Creacoz 210 — 5y
View all comments (6 more)
0
try adding a print inside the if statement and let me know if it prints Arkrei 389 — 5y
0
Does not print after "if request == "Starting" and player.Team == game.Teams.Host then", but before yes. If its only " "if request == "Starting"" it works Creacoz 210 — 5y
0
and you're on the host team right? Arkrei 389 — 5y
0
Yup Creacoz 210 — 5y
0
Im clueless Arkrei 389 — 5y
0
Sameee Creacoz 210 — 5y
Ad

Answer this question