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: Timed Invincibility Script Help

Previous Thread :: Next Thread 
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
30 Jul 2014 10:06 PM
I am currently creating a game and I need help with a script that makes it so players are invincible from other player's weapons for a period of time. After the period of time, they are able to be damaged by other players weapons. I don't want a god or forcefield type thing I just want it so they can't take damage for a certain amount of time.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 02:00 AM
Bump.

Is this even possible? (I'm guessing so)
Report Abuse
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
31 Jul 2014 02:01 AM
Save their old health and set it to 10000000 or math.huge
after a short amount of time set it back to the old value
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 02:05 AM
How do I access their health to do so? With a script? game.Workspace.Players.... ?

I'm a very amateur scripter. I've only made a couple of working and useful scripts, so, I am pretty new.
Report Abuse
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
31 Jul 2014 02:07 AM
Use a local script
game.Players.LocalPlayer.Character.Health = Value
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 02:12 AM
Thanks, I'll test it.

What's the normal player max health?
Report Abuse
DigitalEnvy is not online. DigitalEnvy
Joined: 07 Nov 2010
Total Posts: 3197
31 Jul 2014 02:12 AM
Normal Health is just 100.

Bad or missing mouse driver. Spank the cat [Y/N]?
Report Abuse
Valenthian is not online. Valenthian
Joined: 01 Oct 2013
Total Posts: 590
31 Jul 2014 02:13 AM
local you = game.Players.LocalPlayer
local currenthealth = you.Character.Humanoid.Health
local oldhealth = Instance.new ("NumberValue",you.Character.Humanoid)
oldhealth.Value = currenthealth
you.Character.Humanoid.Health = 1000000000000000
wait(10)
you.Character.Humanoid.Health = oldhealth.Value
wait(0.1)
oldhealth:Destroy()
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 02:15 AM
Thanks a ton guys, definitely helped.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 02:56 AM
Sadly, didn't work, any knowledge why?

repeat

function steff()

local you = game.Players.LocalPlayer
local currenthealth = you.Character.Humanoid.Health
local oldhealth = Instance.new ("NumberValue",you.Character.Humanoid)
oldhealth.Value = currenthealth
you.Character.Humanoid.Health = 1000000000000000
wait(495)
you.Character.Humanoid.Health = oldhealth.Value
wait(300)
oldhealth:Destroy()

end

steff()

until false
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
31 Jul 2014 03:03 AM
Add a default bool value and name it 'Invincible' set it to false

Then figure this out;

if victim:FindFirstChild('Invincible') then
if victim.Invincible.Value == false then
humanoid:TakeDamage(5)
end
end
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 03:09 AM
I need it only for a certain amount of time, not sure where to add the time limits into that.

Also, how do I "add a default bool value"?

So would it be something like this? :

repeat

function invincible()

(SOMETHING REGARDING "DEFAULT BOOL VALUE")
if victim:FindFirstChild('Invincible') then
if victim.Invincible.Value == false then
humanoid:TakeDamage(5)
end
end

invincible()

until false

Keep in mind that I'm new to scripting.
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
31 Jul 2014 03:12 AM
Sorry but this is going to be difficult for you if you don't know how to mess with gun scripts.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 03:27 AM
Gun scripts.... XD Don't even know what that is.

(Unless it's literally just a script that makes a gun work) o.-
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
31 Jul 2014 12:24 PM
Bump?

Still nothing. Thanks for the attempts though.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
01 Aug 2014 07:23 PM
Bump

Seriously, I thought this was possible.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
02 Aug 2014 12:21 AM
Bump.....
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
02 Aug 2014 03:21 PM
Bump.






*Sigh*
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
07 Aug 2014 02:06 AM
Bump.










Again.
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
12 Aug 2014 08:22 PM
Buump.
Report Abuse
Goodis is not online. Goodis
Joined: 14 Jan 2010
Total Posts: 253
12 Aug 2014 08:39 PM
until nil*
Report Abuse
TheGoldenDusekkar is not online. TheGoldenDusekkar
Joined: 29 Sep 2010
Total Posts: 93
12 Aug 2014 09:24 PM
If somebody could explain what a default bool value is and how to use it then maybe I could make a little progress.

(NEW TO SCRIPTING)
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