game.Workspace.CaseD.Touched:connect(function(User) wait(.5) if User.Parent:FindFirstChild("Humanoid") then local Player = game.Players:GetPlayerFromCharacter(User.Parent) if Player.TeamColor == "Bright bluish green" and KF.Value == false then KF.Value = true script.Parent.ServerEffects.Flag:Clone().Parent = User.Parent.Head end end end)
14:04:35.247 - Workspace.ServerScripts.MasterScript:42: attempt to index local 'Player' (a nil value) 14:04:35.248 - Stack Begin 14:04:35.249 - Script 'Workspace.ServerScripts.MasterScript', Line 42 14:04:35.249 - Stack End
check isnt Player nil. TeamColor is a brickcolor, not string.
game.Workspace.CaseD.Touched:connect(function(User) wait(.5) if User.Parent:FindFirstChild("Humanoid") then local Player = game.Players:GetPlayerFromCharacter(User.Parent) if Player ~= nil then if Player.TeamColor == BrickColor.new("Bright bluish green") and KF.Value == false then KF.Value = true script.Parent.ServerEffects.Flag:Clone().Parent = User.Parent.Head end end end end)
EDIT: Try now