Help im trying to make this give admins more health on my game but line 2 is braking the whole script! its also a player has entered the game script but line 2 is the only thing going wrong! Please Help!
function onPlayerEntered() local humanoid = player.Character:findFirstChild("Humanoid") local message = Instance.new("Message") message.Parent = game.Workspace if player.Name ~= "theamazemanII" and player.Name ~= "BUTSTINK" and player.Name ~= "brickfusion" then message.Text = "Welcome "..player.Name.." to Berk!" wait(3) message:remove() else message.Text = "Welcome the Chief Viking "..player.Name.." to Berk!" humanoid.MaxHealth = 500 humanoid.Health = 500 wait(3) message:remove() for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end end end
I can spot 2 errors in your script. First of all, you attempt to call 'player' many times in the function, but the variable (or parameter) doesn't seem to exist.
The second one is in your last block of code. You're attempting to call the function PlayerAdded, but from the code you've provided, that doesn't seem to exist either.
function onPlayerEntered() local humanoid = player.Character:findFirstChild("Humanoid") local message = Instance.new("Message", game.Workspace) message.Parent = game.Workspace if player.Name ~= "theamazemanII" and player.Name ~= "BUTSTINK" and player.Name ~= "brickfusion" then message.Text = "Welcome "..player.Name.." to Berk!" wait(3) message:remove() else message.Text = "Welcome the Chief Viking "..player.Name.." to Berk!" humanoid.MaxHealth = 500 humanoid.Health = 500 wait(3) message:remove() for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end end end