generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Anti-Godmode? *HELP WANTED*

Previous Thread :: Next Thread 
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
25 Aug 2014 08:10 PM
So I wrote this

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
i = 100
repeat wait() until char.Humanoid.Health ~= i
char:breakJoints()
end)
end)

The godmode exploit is tricky. I can't seem to pick it up as a number value above 100 or below 0. I'd like the player to be able to heave health below 0 but not anything besides that. I also tried this.

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
for i = 0, 100
repeat wait() until char.Humanoid.Health ~= i
char:breakJoints()
end
end)
end)

That just killed the player when they spawned... Any ideas?


Jesus saves. Let him in your heart!
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
25 Aug 2014 08:14 PM
You can use the .HealthChanged event on the humanoid

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char.Humanoid.HealthChanged:connect(function ()
if char.Humanoid.Health < 0 or char.Humanoid.Health > 10000 then
char:breakJoints()
end
end)
end)
end)
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
25 Aug 2014 08:15 PM
Thats why .Changed didn't work... THANKS


Jesus saves. Let him in your heart!
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
25 Aug 2014 08:32 PM
This is weird.. I did this and I makes the player godmode. e.e

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
char.Humanoid.HealthChanged:connect(function()
if char.Humanoid.Health < 100 or char.Humanoid.Health == 100 then
char.Humanoit.Health = char.Humanoid.Health
else
char:breakJoints()
end
end)
end)
end)



Jesus saves. Let him in your heart!
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
26 Aug 2014 05:33 AM
Bumpooo
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
26 Aug 2014 01:31 PM
Bamp
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
26 Aug 2014 01:35 PM
local p=game.Players.LocalPlayer
repeat wait(.03)until p.Character
p.Character:WaitForChild'Humanoid'.HealthChanged:connect(function(a)
if a>100 then
p.Character:BreakJoints()
end
end)

I'd suggest making this a LocalScript and put it in StarterGui/Pack
Report Abuse
BatRequiem is not online. BatRequiem
Joined: 04 Jun 2011
Total Posts: 6207
26 Aug 2014 03:16 PM
Nvm, I fixed it. What I was testing with changed the MaxHealth and got me all confused. But thanks!


Jesus saves. Let him in your heart!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image