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: So I am trying to make an onclicked script

Previous Thread :: Next Thread 
Gigantotron is not online. Gigantotron
Joined: 13 Aug 2010
Total Posts: 31058
28 May 2013 06:36 PM
That when the parent is clicked changes the decal on a brick labeled "Jumbotron"

Here is what I have so far :

function onClicked(playerWhoClicked)
script.Parent.BrickColor = BrickColor.Random()
end
Model.Jumbotron.Decal.TextureID=http://www.roblox.com/asset/?id=2042191()

According to ROBLOX the last line is wrong. How do I fix it and how do I add more of those "decal change" lines in?
Report Abuse
Gigantotron is not online. Gigantotron
Joined: 13 Aug 2010
Total Posts: 31058
28 May 2013 06:38 PM
I figure that I am gonna have to put a loop in at the end also.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
28 May 2013 06:39 PM
function onClicked(playerWhoClicked)
script.Parent.BrickColor = BrickColor.Random()
Model.Jumbotron.Decal.TextureID=http://www.roblox.com/asset/?id=2042191--no ()
--What is Model? Define it?
end--end here
script.Parent.ClickDetector.MouseClick:connect(onClicked)--Only works if a ClickDetector is in the brick

--Make sure to read the comments.
Report Abuse
keehl254 is not online. keehl254
Joined: 08 Sep 2010
Total Posts: 131
28 May 2013 06:43 PM
I'm assuming the scripts parent is the part you want them to click...Insert a ClickDetector into the part you want them to click, and this should work for ya :3


function onClicked(playerWhoClicked)
script.Parent.BrickColor = BrickColor.Random()
Model.Jumbotron.Decal.TextureID=http://www.roblox.com/asset/?id=2042191()
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
keehl254 is not online. keehl254
Joined: 08 Sep 2010
Total Posts: 131
28 May 2013 06:44 PM
aww, posted in when there was no comments...Come back, and someelse already posted it :/
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
28 May 2013 06:45 PM
hehe... :3
Report Abuse
Gigantotron is not online. Gigantotron
Joined: 13 Aug 2010
Total Posts: 31058
28 May 2013 06:57 PM
it stil gives me the red line
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
28 May 2013 07:16 PM
function onClicked(playerWhoClicked)
script.Parent.BrickColor = BrickColor.Random()
Model.Jumbotron.Decal.TextureID="http://www.roblox.com/asset/?id=2042191"--" "
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
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