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: This OnClick Script Doesn't Work for Some Reason

Previous Thread :: Next Thread 
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
19 Jul 2016 12:05 PM
function onClicked(click)
if click.Parent:FindFirstChild("Humanoid") ~= nil then

if game.Players:FindFirstChild(click.Parent.Name) ~= nil then

local player = game.Players:FindFirstChild(click.Parent.Name)
if player:FindFirstChild("PlayerGui"):FindFirstChild("SoundGUI") == nil then
player:FindFirstChild("PlayerGui"):ClearAllChildren()
local sg = game.Lighting.SoundGUI:Clone()
sg.Parent = player.PlayerGui
end
end
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
------------------------------------------------------------------
I've checked that SoundGUI is in game.Lighting
The script isn't disabled
The object has a ClickDetector
There's something I missed?
Report Abuse
AxonMega is not online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
19 Jul 2016 12:28 PM
The MouseClick() event returns the player who clicked the ClickDetector.

--don't you people ever check the API?
Report Abuse
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
19 Jul 2016 12:44 PM
But the MouseClick event is the correct event, isn't it?
Report Abuse
Titanicman882ftlong is not online. Titanicman882ftlong
Joined: 14 Aug 2012
Total Posts: 430
19 Jul 2016 12:47 PM
Yes. MouseButton1/2Click/Down/Up are all part of the GUI

MouseClick only works on ClickDetectors, and some other things I can't remember.
Report Abuse
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
19 Jul 2016 12:50 PM
But If the script is correct, why doesn't it work?

Sorry I can't find the answer myself.
Report Abuse
gskw is not online. gskw
Joined: 05 Jan 2013
Total Posts: 1364
19 Jul 2016 12:55 PM
ClickDetectors don't work in FE, if you're using that.
Report Abuse
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
19 Jul 2016 01:44 PM
I'm not using FE.
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
19 Jul 2016 01:51 PM
You should be using FE. Thats your first mistake.


Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
19 Jul 2016 01:55 PM
TimeTicks, you literally post that on every single thread. It's not helping and no one likes your input. When someone asks you how to do something, you don't answer with something completely irrelevant to the question.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
19 Jul 2016 02:07 PM
I post that because that's the right way to do thing. If you aren't willing to do something the right way then what the point? Why should I promote BAD programming habits?


Report Abuse
DogeKip is not online. DogeKip
Joined: 06 Mar 2011
Total Posts: 6860
19 Jul 2016 02:09 PM
@TimeTicks
They're asking for help and clearly they're not ready for FE if they can't manage normal quite yet, they're still learning so either help them learn or leave their posts alone, simple as that. I don't use FE because I don't plan on making large games, I make them for my friends or for proof of concept.


[Redacted]
Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
19 Jul 2016 02:13 PM
It's not wrong to not use FilteringEnabled. It's not like deprecation. It's a feature that roblox allows you to turn on and off for a reason. Newer scripters don't know how to make scripts with FilteringEnabled and have only started out scripting. This isn't the only person you did this to, and trust me when I say this. You're not helping anyone. At this point you're just being an annoying little sht.

https://forum.roblox.com/Forum/ShowPost.aspx?PostID=194048551


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