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 » Scripters
Home Search
 

Re: Script Help

Previous Thread :: Next Thread 
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:05 PM
function onClicked(playerWhoClicked)
script.Parent.Parent.Parent.Transparency = 1
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Somebody who can actually script (unlike me) please fix this for me
Report Abuse
TheeDeathCaster is online. TheeDeathCaster
Joined: 19 Jun 2011
Total Posts: 1191
22 Jun 2017 08:10 PM
Your question is too vague; please explain is detail what your trying to do, and what's not working.

Also, have your question title and explanations reflect what you're trying to do. (Why is my [BLANK] not [BLANK]? Code isn't [BLANK] [BLAH]?)
Report Abuse
oldsteve223 is not online. oldsteve223
Joined: 07 May 2012
Total Posts: 7658
22 Jun 2017 08:10 PM
What's the problem?
Report Abuse
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:12 PM
I want a button Onclicked to change the transparency of a union
Union111->Part->ClickDetector->Script
Report Abuse
oldsteve223 is not online. oldsteve223
Joined: 07 May 2012
Total Posts: 7658
22 Jun 2017 08:13 PM
What does the output say?
Report Abuse
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:14 PM
21:14:47.644 - function onClicked(playerWhoClicked)
script.Parent.Parent.Parent.Transparency = .5
end

script.Parent.ClickDetector.MouseClick:connect(onClicked):5: attempt to index global 'script' (a nil value)
21:14:47.648 - Stack Begin
Report Abuse
oldsteve223 is not online. oldsteve223
Joined: 07 May 2012
Total Posts: 7658
22 Jun 2017 08:15 PM
Where is your script at? Try making it a direct child of the union.
Report Abuse
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:16 PM
A part is inside the union and inside the union is a clickdetector then inside the clickdetector is the script
Report Abuse
oldsteve223 is not online. oldsteve223
Joined: 07 May 2012
Total Posts: 7658
22 Jun 2017 08:19 PM
If the click detector is inside the union, and this script is inside of that, then it looks like you have your hierarchy wrong. Try this.



function onClicked(playerWhoClicked)
script.Parent.Parent.Transparency = 1
end

script.Parent.MouseClick:connect(onClicked)
Report Abuse
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:21 PM
Ok I had it right I must of spelled something wrong or capitalized something wrong I copied yours and added a parent and now it works, thanks
Report Abuse
oldsteve223 is not online. oldsteve223
Joined: 07 May 2012
Total Posts: 7658
22 Jun 2017 08:22 PM
No problem.
Report Abuse
Jacobmcp is online. Jacobmcp
Joined: 26 Dec 2014
Total Posts: 54
22 Jun 2017 08:25 PM
I put .ClickDetector instead of MouseClick
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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