Gybron
|
  |
| Joined: 02 Sep 2009 |
| Total Posts: 1747 |
|
|
| 16 Aug 2014 07:49 AM |
So, this script removes a morph called "Chest" from player character. But if you click it twice, it breaks, since it finds nothing to delete in the second click. How can I fix that? thank thee
wait(1) player = game:GetService("Players").LocalPlayer gui = script.Parent button = gui.Button button.MouseButton1Down:connect(function() local found = player.Character:findFirstChild("Chest")
if found then end found:Destroy() player.Character.Humanoid.MaxHealth = 100 wait(0.1) end) |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 07:56 AM |
| can you give the output of the script |
|
|
| Report Abuse |
|
|
Gybron
|
  |
| Joined: 02 Sep 2009 |
| Total Posts: 1747 |
|
|
| 16 Aug 2014 08:04 AM |
ROBLOX site somewhy errors when I copypasted output's stuff in here, so I had to take a gyazo pic
http://gyazo.com/ae85463c4a8d4882426637d9d9c61da0 |
|
|
| Report Abuse |
|
|
|
| 16 Aug 2014 08:14 AM |
if the spot where it says found:Destroy does that need a number try typing 1 then if not copy it then delete it so its still saved and then test it one last thing when you run a script and its gonna do something to you character i would play solo and it should work so try typing a number then if that doesn't work when you test it in play solo try deleting it and test it again
please try both ways |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 16 Aug 2014 08:17 AM |
wait(1) player = game:GetService("Players").LocalPlayer gui = script.Parent button = gui.Button button.MouseButton1Down:connect(function() local found = player.Character:FindFirstChild("Chest") if found ~= nil then found:Destroy() player.Character.Humanoid.MaxHealth = 100 wait(0.1) end end) |
|
|
| Report Abuse |
|
|
Gybron
|
  |
| Joined: 02 Sep 2009 |
| Total Posts: 1747 |
|
| |
|