function HDied(aplayer) wait(1) player = game.Players:GetPlayerFromCharacter(aplayer) if player ~= nil then game.Lighting.GuiFlash.Value = false print(player) game.Lighting.GuiText.Value = (player.. " has died!") player.TeamColor = BrickColor.new("Forest green") end end
please help!
aplayer
I'm assuming is an Instance of a player
to fix this, just do player.Name
instead of trying to concatenate just player
(an instance)
function HDied(aplayer) wait(1) player = game.Players:GetPlayerFromCharacter(aplayer) if player then -- ~= nil is not necessary unless you have to state it as a comparison game.Lighting.GuiFlash.Value = false print(player) game.Lighting.GuiText.Value = (player.Name.. " has died!") player.TeamColor = BrickColor.new("Forest green") end end