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
 

Help with a message on click script

Previous Thread :: Next Thread 
spitfire3527 is not online. spitfire3527
Joined: 23 Nov 2009
Total Posts: 1430
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
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
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
spitfire3527 is not online. spitfire3527
Joined: 23 Nov 2009
Total Posts: 1430
21 Mar 2012 09:11 PM
Will this show the message to only the person who clicks it?

-Scripting is fun :3
Report Abuse
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
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 is not online. 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
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
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 is not online. 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
ServerLabs is not online. ServerLabs
Joined: 29 Dec 2010
Total Posts: 2263
23 Mar 2012 04:34 PM
@Tiranin

Shows how long I haven't messed around with those, haha.
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