|
| 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 |
|
|
|
| 31 Jul 2014 02:00 AM |
Bump.
Is this even possible? (I'm guessing so) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 31 Jul 2014 02:07 AM |
Use a local script game.Players.LocalPlayer.Character.Health = Value |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 02:12 AM |
Thanks, I'll test it.
What's the normal player max health? |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2014 02:12 AM |
Normal Health is just 100.
Bad or missing mouse driver. Spank the cat [Y/N]? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 31 Jul 2014 02:15 AM |
| Thanks a ton guys, definitely helped. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 31 Jul 2014 12:24 PM |
Bump?
Still nothing. Thanks for the attempts though. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2014 07:23 PM |
Bump
Seriously, I thought this was possible. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
Goodis
|
  |
| Joined: 14 Jan 2010 |
| Total Posts: 253 |
|
| |
|
|
| 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 |
|
|