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: ClickDetector

Previous Thread :: Next Thread 
Implore is not online. Implore
Joined: 22 Aug 2011
Total Posts: 4996
26 Nov 2016 11:17 PM
script.Parent.Parent.ClickDetector.MouseClick:connect(function(onClick)
script.Parent.Parent.Transparency = 1
script.Parent.Parent.CanCollide = true

if script.Parent.Parent.CanCollide == true then
wait(5)
script.Parent.Parent.CanCollide = false


if script.Parent.Parent.Transparency == 1 then
wait(5)
script.Parent.Parent.Transparency = 0

end
end

end)

--returns that Model1 isn't a valid member of Model

trying to make it where if Transparency = 1 then it goes back to 0

can someone help?
Report Abuse
Implore is not online. Implore
Joined: 22 Aug 2011
Total Posts: 4996
26 Nov 2016 11:18 PM
Also, am I suppose to put the ClickDetector in part or put the script inside of ClickDetector?
Report Abuse
Implore is not online. Implore
Joined: 22 Aug 2011
Total Posts: 4996
26 Nov 2016 11:21 PM
EDIT: it works, I fixed it
Report Abuse
Implore is not online. Implore
Joined: 22 Aug 2011
Total Posts: 4996
26 Nov 2016 11:26 PM
Another question though

if I have a model, can I use one script to do the same above instead of making so many copies for each part?

If so, what would I do?
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
26 Nov 2016 11:53 PM
for loops.

--click detector

bool = not bool

for i,v in next, model:GetChildren() do
if bool then
v.Transparency = 1
else
v.Transparency = 0
end
end


Report Abuse
Implore is not online. Implore
Joined: 22 Aug 2011
Total Posts: 4996
27 Nov 2016 12:03 AM
Now it goes away 1 part by 1 part, but I want it to go away as a whole.

Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
27 Nov 2016 12:04 AM
dont add any waits in the loop

also if u must paste code


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