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

Why this may not work? [Teams, "If val1 == ... or val1 == ..."]

Asked by 6 years ago
Edited 6 years ago
if Plr.Team == nil or Plr.Team == "Neutral" then

Is it something with "or", or team "Neutral"? I can't use game.Teams.Neutral becouse it can get deleted.

(I need it for custom team script)

I have an idea how to fix that, but it may be unreliable on slow servers.

0
It's because you're trying to compare the team object that it's expecting to a string, you should be able to amend .Name to the object to fix it. Use for the "or" portion; Plr.Team.Name == "Neutral" M39a9am3R 3210 — 6y
0
Oh wait, I forgot. There's a Neutral property of Players that can be utilized instead. http://wiki.roblox.com/index.php?title=API:Class/Player/Neutral You would just be doing: if Plr.Neutral == false then M39a9am3R 3210 — 6y
0
Thank you! Can't vote up cuz I have only 1 rep Shadowman670 -4 — 6y

Answer this question