KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 07:29 PM |
I try this
script.Parent.Touched:connect(function(hit) if hit.Name == "ImageLabel2" then print("starting") Instance.new("Message",Game.Workspace).Text = "uh oh, we have a car crash" end end)
It doesen't print starting! and once my 2 images touch, it doesen't print starting or make teh message. Help please.
|
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
|
| 06 Feb 2014 07:31 PM |
| Because hit.name isn't imagelabel2 |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 07:31 PM |
| I posted before but some people gave me a really confusing wiki page that i don;t understand at all. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 07:33 PM |
Yum, I've seen you on posts. U do not know any lua. You thought a clickdetector was
script.Parent.ClickDetector.MouseButton1
lol, so, learn lua before u can help people
And, Yes!!! THE HIT'S NAME IS IMAGELABEL2! |
|
|
| Report Abuse |
|
|
YumERAGON
|
  |
| Joined: 18 Apr 2012 |
| Total Posts: 3893 |
|
| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
heroesp
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 3214 |
|
|
| 06 Feb 2014 07:38 PM |
If you want a car crash to happen when they click the GUI then make a TextButton remove the Text add a imagelabel inside of it and then do a MouseButton1Down event.
Example
script.Parent.MouseButton1Down:connect(function() print("Has been clicked") end)
-- What this does is whenever the scripts parent is clicked it will print "Has been clicked" |
|
|
| Report Abuse |
|
|
heroesp
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 3214 |
|
|
| 06 Feb 2014 07:40 PM |
| + The argument for Touched is whatever touched it... You want a imagelabel touch it? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:48 PM |
How about:
script.Parent.Touched:connect(function(ImageLabel2) print("starting") Instance.new("Message", game.Workspace).Text = "uh oh, we have a car crash" end)
I am not sure, but it looks right to me |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 07:53 PM |
That wont change anything
an argument can be called anyting.
And, I wnt it to check when they crash (They Tween to the same position in a diff script |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:55 PM |
| Touched doesnt work on GUI's...You have to make it check the position of both of the GUI's and if they are at a certain position, make it run something. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 07:56 PM |
C'mon, it can be used for MANY things. like..... a gui where someone walks and if a mountain is there, then stop the walk function
how would I do it
I think touched only applys to parts, not imagelabels, so, how would I? If it's a bunch of math, then can someone post teh math?
|
|
|
| Report Abuse |
|
|
heroesp
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 3214 |
|
|
| 06 Feb 2014 07:58 PM |
| What do you want to happen exactly? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:58 PM |
Hello idiot. Touched only works on parts. That's it. If you want someone to be able to appear like they're "touching" a 3D gui. Use BillboardGui. If you want the someone to have a 2D gui on their screen, use a button. Here's a quick way to learn, go to the wiki. Press Alt+X. If it doesn't work, do it again. Worked for me. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 07:59 PM |
t1 = first GUI (i.e. script.Parent.TexLabel) t2 = 2nd GUI (i.e. script.Parent.TexLabel)
function check() if t.Position == t2.Position then print("The 2 GUI's are perfectly aligned!") end
t1.Changed:connect(check) t2.Changed:connect(check)
--Something like this. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 08:08 PM |
| DragonODeath, shut ur face |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 08:10 PM |
As hostile as he was, there is no actual touched event for GUI objects (textlabel, textbox, etc.) You have to use fairly basic math |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 08:11 PM |
I already posted that I thought that. Btw, what type of math |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 06 Feb 2014 08:11 PM |
| addition subtraction and greater than or less than |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 06 Feb 2014 08:12 PM |
Addition, Subtraction, Comparing (greater than/less than) Here, this may help you http://wiki.roblox.com/index.php/Collision_detection_for_GUIs |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 08:21 PM |
| meh, thats the same confusing wiki, but ok. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 06 Feb 2014 08:21 PM |
| nvm, its completely different :D |
|
|
| Report Abuse |
|
|