|
| 21 Mar 2012 09:02 PM |
debounce = false function onClicked() if debounce == false then debounce = true m = Instance.new("Message") m.Parent = game.Workspace m.Text = "The Great Desert" wait(1) m:remove() debounce = false end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I want it so that only the person who clicks it sees the message so others dont get annoyed when a noob spams the messages. But i cant get it to work D: It keeps showing everyone the message. I will pay 500 robux if someone helps me. Just make the shirt after you pm me the rewritten script thank you! |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2012 09:07 PM |
I don't like using debounce, it might be deprecated, not sure.
I'd much rather use a cooldown, or disable the click detector for the time being.
function onClicked() m = Instance.new("Message") m.Parent = game.Workspace m.Text = "The Great Desert" v = script.Parent.ClickDetector wait(1) m.Parent = game.Lighting v.Parent = game.Lighting wait(5) -- Wait 5 seconds before the clickdetector returns v.Parent = script.Parent end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
|
| 21 Mar 2012 09:11 PM |
Will this show the message to only the person who clicks it?
-Scripting is fun :3 |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2012 09:12 PM |
| No, there is no way to find the clicker of a ClickDetector as far as I know. |
|
|
| Report Abuse |
|
|
Tiranin
|
  |
| Joined: 03 Apr 2009 |
| Total Posts: 18850 |
|
|
| 22 Mar 2012 01:08 AM |
@Server
Yes there is. They added that 3 or 2 months ago. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2012 01:32 AM |
| Put it in a local script. Then the script will only run on the players computer who clicked it and nobody else will see it except for the player. |
|
|
| Report Abuse |
|
|
Cheater
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 5258 |
|
|
| 22 Mar 2012 02:48 AM |
| You could use ...OnClicked(mouse)... and define mouse there. It's a possible way to find the clicker. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2012 04:34 PM |
@Tiranin
Shows how long I haven't messed around with those, haha. |
|
|
| Report Abuse |
|
|