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: Flipper biscuits on a script

Previous Thread :: Next Thread 
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 05:20 PM
Hopefully that title got some people attention. lol
Mmk, so I'm making a game called, "The mysterious cave" It's kinda a mystery thingy meant to be played on single player, so I thought maybe I could do something cool. Dunno what that had to do with it. Anyway, one part of the game includes you not being able to pass a room full of water that has an electric current running though it. The only way you can get past it is if you turn off the electricity. So if I made a generator sort thing, put an off button and put this script in it -
--------------------------
function onClicked()
wait(0.01)
game.Workspace.Water.killscript.Disabled = true
end
game.Workspace.buttonname.onClicked:connect(onClicked)
-------------------------------------------------------------------------
I probably made a mistake somewhere along the lines of this. I know this seems like something someone should have no problem with, but I don't know, I've always had serious trouble with the simplest on scripting. Any help would be appreciated.
-=Robo=-
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 05:30 PM
eh bump
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
05 Jul 2012 05:33 PM
I'm not sure if you can Enable/Disable scripts via Scripts. How about placing a value inside the water or whatever is supposed to kill you and then it changes until the button is pressed and it will only kill when the value is either true or false whichever you choose.
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
05 Jul 2012 05:33 PM
function onClicked()
wait(0.01)
game.Workspace.Water.killscript.Disabled = true
end
game.Workspace.buttonname.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
05 Jul 2012 05:33 PM
@Whiterain
Yea you can.
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
05 Jul 2012 05:34 PM
thanks. ^^
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 05:52 PM
So, if I put this value into the water block and then redid the kill script to look like this...
--------------------------

function onTouch(part)
if game.Workspace.Water.tehvalue.Value = 1 then
local humanoid = part.Parent:findFirstChild("Humanoid")
if (humanoid ~=nil) then
humanoid.Health = 0
else if
end
end

script.Parent.Touched:connect(onTouch)
---------------------------
And along with that I changed the button script...
---------------------------
function onClick(part)
wait(0.01)
game.Workspace.Water.tehvalue.Value = 1
end
game.Workspace.buttonname.onClick:connect(onClick)
---------------------------
Still not working. I don't understand.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 06:01 PM
yet another lebumpay
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
05 Jul 2012 06:05 PM
idk if this is the problem but you have an unneeded else if, just make it

    else
    end
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
05 Jul 2012 06:07 PM
also, did you receive any output?
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 06:15 PM
Yeah, I did, it says -
OnClicked is not a valid member of Part.
--------------------
17:50:35 - onClicked is not a valid member of Part
17:50:35 - Script "Workspace.buttonname.Script", Line 5
17:50:35 - stack end
--------------------
See?
-=Robo=-
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 06:28 PM
I came to the conclusion that the onclicked event isn't in the part, so I changed the event to
game.Workspace.buttonname.ClickDetector:connect(OnClick)
-----------------------------------------------------------------------
Doesn't work, still. Gotta different output.
-----------------------------------------------------------------------
18:25:02 - connect is not a valid member of ClickDetector
18:25:02 - Script "Workspace.buttonname.Script", Line 5
18:25:02 - stack end
-----------------------------------------------------------------------
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 06:58 PM
WOW STILL NO REPLIES. AWESOME.
Report Abuse
Biostream is not online. Biostream
Joined: 28 Mar 2011
Total Posts: 913
05 Jul 2012 07:01 PM
game.Workspace.buttonname.ClickDetector.onClick:connect(onClick)
I think that's the proper event.
Report Abuse
Biostream is not online. Biostream
Joined: 28 Mar 2011
Total Posts: 913
05 Jul 2012 07:01 PM
*game.Workspace.buttonname.ClickDetector.MouseClick:connect(onClick)
Report Abuse
WhiteRain is not online. WhiteRain
Joined: 24 Apr 2010
Total Posts: 2723
05 Jul 2012 07:12 PM
Post your current script.
Report Abuse
robocu3 is not online. robocu3
Joined: 13 Mar 2009
Total Posts: 6485
05 Jul 2012 10:21 PM
bump
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