Help with God Mode Command

hey man i got it solved! I will share the script if anyone wanna use it!

players.PlayerAdded:Connect(function(player)		
	if player:GetRankInGroup(Settings.Main.RoCore) >= Settings.Main.RequiredRank or Settings.Main.VipOwners == player.UserId then
		
		player.Chatted:Connect(function(message)
			message = string.lower(message)
			local splitMessage = string.split(message, " ")
			
			local humanoid = player.Character:WaitForChild("Humanoid")
			
			if splitMessage[1] == Settings.Fun.God then
				
				
				HealthConnect = humanoid.HealthChanged:Connect(function()
					HealthBool = true
					humanoid.Health = 100
					print(HealthBool)
				end)
				
			elseif splitMessage[1] == Settings.Fun.UnGod then
				HealthBool = false
				HealthConnect:Disconnect()
				humanoid.Health = 90
			end
			
				
		end)
	end
end)

1 Like