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: Is function onClick(click) a thing?

Previous Thread :: Next Thread 
xxxtentaci_on is not online. xxxtentaci_on
Joined: 08 Jan 2012
Total Posts: 1767
17 May 2017 04:05 PM
Because I tried it in this script and it doesn't work. If it isn't then how can I fix this?

function onClick(click)
local player = game.Players:GetPlayerFromCharacter(click.Parent)
if player then
if game.Workspace.DJBooth.Sound.Playing == false then
game.ReplicatedStorage.Music:Clone().Parent = player.PlayerGui
elseif game.Workspace.DJBooth.Sound.Playing == true then
print("Already playing")
end
end
end
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
17 May 2017 04:06 PM
you need to connect the event to the function
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
17 May 2017 04:07 PM
WE HAVE GONE THROUGH THIS ALREADY.

SNOW ANSWERED YOUR ERROR.
Report Abuse
xxxtentaci_on is not online. xxxtentaci_on
Joined: 08 Jan 2012
Total Posts: 1767
17 May 2017 04:13 PM
That is not the whole script lol
Report Abuse
xxxtentaci_on is not online. xxxtentaci_on
Joined: 08 Jan 2012
Total Posts: 1767
17 May 2017 04:14 PM
14:14:20.498 - Workspace.DJBooth.GuiOpener.Script:10: attempt to index local 'click' (a nil value)
Report Abuse
xxxtentaci_on is not online. xxxtentaci_on
Joined: 08 Jan 2012
Total Posts: 1767
17 May 2017 04:21 PM
Bump
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
17 May 2017 04:28 PM
the click argument is a variant meaning it can be anything but also nil. So if click is nil then the argument will pass a nil value and thats where the error comes in.
Report Abuse
xxxtentaci_on is not online. xxxtentaci_on
Joined: 08 Jan 2012
Total Posts: 1767
17 May 2017 04:29 PM
bump
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
17 May 2017 04:29 PM
what event did you connect it to?
Report Abuse
LowOnXTC is not online. LowOnXTC
Joined: 02 Jul 2012
Total Posts: 563
17 May 2017 04:42 PM
stop bumping this, it's already been answered, you're not getting anymore answers..give up


ooga booga
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