I am working on a script so if the flags owner is a certain team then they will spawn on the flag Right now I am just testing, I will add the spawn part in later but why wont this work?
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner.Value == " Olive " then print("Sounds good") end
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner.Value == " Olive " then print("Sounds good") end
You have no if. You are trying to use then on a local variable.
If you wanted Owner to be true or false, then it would be
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner.Value == " Olive " and true
The below should work for you
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner -- if you put .Value here then if it changes, you won't know. you need to get in in real time, like below. if Owner.Value == "Olive" then print("Sounds good") end
Simple. You need to use the variable after you have declared it.
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner.Value if Owner == " Olive " then print("Sounds good") end
Or
local Owner = game.Workspace.CapturableFlag.OfVanna.CurrentOwner.Value == " Olive " if Olive then print("Sounds good") end