God Script doesn't actually god the player

What do you want to achieve? I’m trying to use a script that will god the player if they’re above a certain rank in the group.

What is the issue? It doesn’t work; I attached a photo of the output below.
image

I’m not good at scripting, so bear with me here.

Code:

game.Workspace.ChildAdded:connect(function(Player) 
if Player:GetRankInGroup(7634323) >= 5 then
Player.Humanoid.MaxHealth = math.huge
Player.Humanoid.Health = math.huge 
end 
end)
1 Like

The problem is at the game.Workspace.ChildAdded, it activates everytime a child is added to workspace.

Since you are wanting to do it with players then you should use a service that gets the actual player.

game.Players.PlayerAdded:Connect(function(Player)

end)

I guess this is enough for your problem.

3 Likes