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: Reset GUI help?

Previous Thread :: Next Thread 
waioo is not online. 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 is not online. corto713
Joined: 12 Dec 2009
Total Posts: 962
16 Oct 2012 03:10 PM
Connection line "Clicked" should "MouseButton1Down"
Report Abuse
spearman2 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
16 Oct 2012 03:18 PM
Or MouseButton1Click
Report Abuse
corto713 is not online. 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 is not online. spearman2
Joined: 28 May 2010
Total Posts: 2938
16 Oct 2012 03:22 PM
It's sorta the same
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
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 is not online. 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 is not online. 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 is not online. 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
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
16 Oct 2012 09:05 PM
@cnt, no this is

script.Parent.MouseButton1Down:connect(function()
game.Players.LocalPlayer.Character:BreakJoints() end)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
16 Oct 2012 09:12 PM
mine is still the bestest

¤ ¤ † K M X D † ¤ ¤
Report Abuse
cntkillme is not online. 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
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