I have a LocalScript for making a client sided BoolValue named "FFA" and it sets the BoolValue to true and false depending on what team you're on. Here is the code:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local UpDatFFA = ReplicatedStorage:WaitForChild("UpdateFFA")
local ffa = Instance.new("BoolValue")
ffa.Name = 'FFA'
ffa.Parent = player.character
ffa.Value = true
local function FFAFired()
if player.TeamColor == BrickColor.new("Black") then
ffa.Value = false
end
end
UpDatFFA.OnClientEvent:Connect(FFAFired)
This works perfectly fine, it creates the BoolValue named FFA with the value set to true in the Player's character. It even sets the BoolValue to false whenever the player is on the "Black" team.
However, here I have the same code with just the true and false variables swapped. It creates the BoolValue like it's supposed to, it's even set to false as it should be. Although, whenever the Player is swapped to the "Black" team, it doesn't set the BoolValue to true, even though I literally just swapped the true and false placements from the previous code. Here is the code:
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer
local UpDatFFA = ReplicatedStorage:WaitForChild("UpdateFFA")
local ffa = Instance.new("BoolValue")
ffa.Name = 'FFA'
ffa.Parent = player.character
ffa.Value = false
local function FFAFired()
if player.TeamColor == BrickColor.new("Black") then
ffa.Value = true
end
end
UpDatFFA.OnClientEvent:Connect(FFAFired)
Can anyone tell me why this is happening or at least send me in the direction of fixing it? I would greatly appreciate the help.

1 comment
Thanks for the guidance! It helped me fix it.