waioo
|
  |
| Joined: 14 Sep 2010 |
| Total Posts: 3615 |
|
|
| 16 Oct 2012 02:12 PM |
would this work? my friend needs a GUI reset button and im trying to help him out. .-. if it needs changes, it would probably be on line 3. all the rest works in a kill brick, except for changes like GUI being Lava, or TextButton being Brick. pls help
local GUI = script.Parent function onClicked(TextButton) local Player = TextButton.Parent:findFirstChild("Humanoid") if (Player ~= nil) then Player.Health = 0 end end GUI.Clicked:connect(onClicked)
--[WAIOOSCRIPT]--
_____________________________________ Script up there^^^
hail alkia. |
|
|
| Report Abuse |
|
|
corto713
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 962 |
|
|
| 16 Oct 2012 03:10 PM |
| Connection line "Clicked" should "MouseButton1Down" |
|
|
| Report Abuse |
|
|
spearman2
|
  |
| Joined: 28 May 2010 |
| Total Posts: 2938 |
|
| |
|
corto713
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 962 |
|
|
| 16 Oct 2012 03:20 PM |
| Mine is 1 letter shorter and easier to remember XP |
|
|
| Report Abuse |
|
|
spearman2
|
  |
| Joined: 28 May 2010 |
| Total Posts: 2938 |
|
| |
|
|
| 16 Oct 2012 03:23 PM |
local GUI = script.Parent function onClicked(TextButton) local Player = TextButton.Parent:findFirstChild("Humanoid") -- TextButton isn't inside your character, but your Player's PlayerGui, and a ScreenGUI at minimum. if (Player ~= nil) then Player.Health = 0 end end GUI.Clicked:connect(onClicked)
script.Parent.MouseButton1Down:wait() game:GetService("Players").LocalPLayer.Character:FindFirstChild("Humanoid").Health=0 |
|
|
| Report Abuse |
|
|
spearman2
|
  |
| Joined: 28 May 2010 |
| Total Posts: 2938 |
|
|
| 16 Oct 2012 04:01 PM |
OR
local p = script.Parent.Parent.Parent.Parent
function Click() if p then p.Character.Humanoid.Health = 0 p.Character.Head:Destroy() -- OverKill :P end end
script.Parent.MouseButton1Click:connect(Click)
--That one might work |
|
|
| Report Abuse |
|
|
waioo
|
  |
| Joined: 14 Sep 2010 |
| Total Posts: 3615 |
|
|
| 16 Oct 2012 07:14 PM |
wait i gave the script to my friend that i made and it worked. .-. is that supposed to happen?
hail alkia. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Oct 2012 09:03 PM |
this is shortest:
script.Parent.MouseButton1Down:connect(function() game.Players.LocalPlayer.Character["Humanoid"].Health = 0 end) |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 09:05 PM |
@cnt, no this is
script.Parent.MouseButton1Down:connect(function() game.Players.LocalPlayer.Character:BreakJoints() end) |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 09:07 PM |
script.Parent.MouseButton1Down:wait() pcall(function() Game.Players.LocalPlayer.Character:BreakJoints() end)
¤ ¤ † K M X D † ¤ ¤
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Oct 2012 09:07 PM |
My way stiill works, except urs is even shorter :( SHORTESTL
script.Parent.MouseButton1Up:connect(function() Players.LocalPlayer.Character:BreakJoints() end) |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 09:12 PM |
mine is still the bestest
¤ ¤ † K M X D † ¤ ¤ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Oct 2012 09:13 PM |
| It will all work the same, we are hgoing for shortest, but urs will prevent glitch(es) |
|
|
| Report Abuse |
|
|