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: SmartPeople@ Why isn't this working? :'(

Previous Thread :: Next Thread 
Buzzlightyear32123 is not online. Buzzlightyear32123
Joined: 06 Jul 2010
Total Posts: 6378
28 Jan 2014 02:11 PM
I made a exoskeleton(morph) and I added a couple of GUI's to make it a bit more interactive. One of the GUI's are a "Helmet off" feature. When clicked, it's supposed to take away your helmet, and when you click "Helmet on", it is supposed to attach back onto you.

Here is the game if you want to test it out for yourself.

http://www.roblox.com/Remaking-all-42-Iron-Man-suits-place?id=142188733


The morph consists of two helmet parts. One that's visible all the time (unless clicked helmet off), and one is above your head that has "1" transparency. When clicked, it's supposed to create the illusion that your helmet has gone above your head so you can speak clearly. (the speaking part has nothing to do with it, it's just for RP purposes).

And here is the script to take the helmet off,


local player = script.Parent.Parent.Parent.Parent.Parent

function onClick(mouse)

player.Character.ATorso.Helmet.Transparency = 1
player.Character.ATorso.Helmet1.Transparency = 0

end

script.Parent.MouseButton1Down:connect(onClick)







And yes, I added one section called "Helmet" and one section called "Helmet1", so this SHOULD be working. But I have no idea why not. :c Thanks if you try helping. :)
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
28 Jan 2014 02:13 PM
Is this a gui?
If it is, MouseButton1Down is a MOUSE event, not a Gui event

Try:

script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
Buzzlightyear32123 is not online. Buzzlightyear32123
Joined: 06 Jul 2010
Total Posts: 6378
28 Jan 2014 02:16 PM
:0

I'm gonna give it a try.
Report Abuse
crossbar is not online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
28 Jan 2014 02:18 PM
Please read on my GUI tutorial, it's really similar to this.

http://www.roblox.com/Forum/ShowPost.aspx?PostID=124293129

Also,

local player = script.Parent.Parent.Parent.Parent.Parent

function onClick(mouse)

player.Character.ATorso.Helmet.Transparency = 1
player.Character.ATorso.Helmet1.Transparency = 0

end

script.Parent.MouseButton1Down:connect(onClick)

"player.Character.ATorso.Helmet.Transparency = 1
player.Character.ATorso.Helmet1.Transparency = 0" That's your problem. Add in a few if statements! xD

hat = player.Character.ATorso.Helmet* Define this

if hat.Transparency == 1 then
hat.Transparency = 0
else if hat.Transparency == 0 then
hat.Transparency = 1
end
end

Do something like that maybe?
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
28 Jan 2014 02:20 PM
^ His problem is that he's using an event that GUI's don't even have.
Report Abuse
crossbar is not online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
28 Jan 2014 02:21 PM
"local player = script.Parent.Parent.Parent.Parent.Parent

function onClick(mouse)

player.Character.ATorso.Helmet.Transparency = 1
player.Character.ATorso.Helmet1.Transparency = 0

end"

Tell me that isn't a problem. And GUIs have MouseButton1Down..
Report Abuse
crossbar is not online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
28 Jan 2014 02:22 PM
It might not be, but it's not the way I would do it to say fairly. xD
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
28 Jan 2014 02:24 PM
The tag is messy and the function is moot
Either way, they're not causing his code to break

Also, the event you're referring to would go off if he clicked anywhere on the screen and just so happened to move his mouse on the button while clicking
Don't think he wants that to happen
Report Abuse
Joey370 is not online. Joey370
Joined: 16 Dec 2012
Total Posts: 71
28 Jan 2014 02:27 PM
ROBLOX studio is crap. Try local scripts.
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