litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 03:35 PM |
This script is fully functional until a person dies, then it doesn't work.
player = script.Parent.Parent player.CharacterAdded:wait() character1 = player.Character character1:WaitForChild("Scripts")
character1.Humanoid.MaxHealth = character1.Scripts.CurrentMaxHealth.Value character1.Humanoid.Health = character1.Scripts.CurrentMaxHealth.Value
character1.Scripts.CurrentMaxHealth.Changed:connect(function(NewValue) character1.Humanoid.MaxHealth = NewValue character1.Humanoid.Health = NewValue end)
I'm assuming its because the character was removed and a new one added with the same name, but I don't know how to work around that. ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
| |
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 03:59 PM |
gah
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
| |
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Jul 2015 05:37 PM |
Keep the scripts disabled and clone them into the player. Then you can enable them. When the player dies, clone the disabled scripts into the player and repeat the process
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 05:56 PM |
Tried doing this in another script:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) character:WaitForChild("Humanoid").Died:connect(function() local allah = player.PlayerScripts.LocalScript wait("8") local a = allah:Clone() a.Parent = player.PlayerScripts allah:Destroy() print("done") end) end) end)
itll print done but the new script won't work
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Jul 2015 05:58 PM |
local script*
not
local allah
script makes more sense as a variable since you are using LocalScript
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 06:01 PM |
that doesnt really change anything tho
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
| |
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
|
| 07 Jul 2015 10:06 PM |
| Ugh...... it's pointless to reply if you won't understand. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 10:10 PM |
Please explain c;
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
|
| 07 Jul 2015 10:19 PM |
player = script.Parent.Parent game.Players.PlayerAdded:connect:function(plr) plr.CharacterAdded:connect(function(chr)
character1 = chr character1:WaitForChild("Scripts")
character1.Humanoid.MaxHealth = character1.Scripts.CurrentMaxHealth.Value character1.Humanoid.Health = character1.Scripts.CurrentMaxHealth.Value
character1.Scripts.CurrentMaxHealth.Changed:connect(function(NewValue) character1.Humanoid.MaxHealth = NewValue character1.Humanoid.Health = NewValue
end) end)
|
|
|
| Report Abuse |
|
|
Sevrick
|
  |
| Joined: 22 Oct 2013 |
| Total Posts: 3846 |
|
|
| 07 Jul 2015 10:19 PM |
| --Sorry, remove the player variable. |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 07 Jul 2015 10:23 PM |
Works like normal until I reset, still doesnt work when I reset.
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 08 Jul 2015 01:42 PM |
gah
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 08 Jul 2015 06:07 PM |
c;
last try
ᴍʏ ɴɪɢᴀ ғʀᴏᴍ ᴀɴᴏᴛʜᴇʀ ᴡɪɢᴀ |
|
|
| Report Abuse |
|
|