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
 

Scenario: I use this script. Would it work?

Previous Thread :: Next Thread 
ShadowKnight619ALT is not online. ShadowKnight619ALT
Joined: 25 Mar 2011
Total Posts: 102
21 Dec 2011 02:13 PM
if OnTouched
script.Parent.Transparency= 1
if OnClicked()
script.Parent.CanColide= false

end
end
script.Parent.Touched:connect(OnTouched)
script.Parent.ClickDetector.MouseClick:connect(OnClicked)



I've never made an 'if' script before, and I've never researched how to make one, so I just want to know if it would work, and if not, why.
Report Abuse
ShadowKnight619ALT is not online. ShadowKnight619ALT
Joined: 25 Mar 2011
Total Posts: 102
21 Dec 2011 02:19 PM
bump
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
21 Dec 2011 02:23 PM
No, this wouldn't work at all... For a few reasons...

> if OnTouched

Well... First of all, OnTouched isn't defined, and secondly, the if statement needs a 'then'. So it would be:

    if OnTouched then
    -- BTW, this won't work unless you have OnTouched defined as a variable

The second thing is...

> if OnClicked()

Well... Unless OnClicked() returns a boolean (true or false), then this won't work. Also, it has no 'then' to go with it.
Report Abuse
ShadowKnight619ALT is not online. ShadowKnight619ALT
Joined: 25 Mar 2011
Total Posts: 102
21 Dec 2011 02:41 PM
Thanks for the help. If you wouldn't mind, could you write up what the finished script would be?
Report Abuse
Kepie is not online. Kepie
Joined: 12 Nov 2011
Total Posts: 884
21 Dec 2011 02:56 PM
@TheNewScripter, you forgot to put (hit) on the OnTouched xD like this:

OnTouched(hit)
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