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: No output..

Previous Thread :: Next Thread 
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
10 Oct 2016 07:43 PM
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("BasePart") then
local cd = Instance.new("ClickDetector", v)
cd.MouseClick:connect(function()
print("beep")
local snd = script.Parent.Sound:Clone()
snd.Parent = v
snd:Play()
wait(snd.TimeLength)
snd:Destroy()
end)
end
end

Not sure what's wrong. It prints nothing in the output, nor plays any sounds.
Report Abuse
PhantomVisual is not online. PhantomVisual
Joined: 08 Apr 2011
Total Posts: 2025
10 Oct 2016 07:46 PM
would it be
cd.MouseClick:connect(function())
not
cd.MouseClick:connect(function()


Report Abuse
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
10 Oct 2016 07:49 PM
@Phantom

No, because there's code wrapped inside of the function.
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
10 Oct 2016 07:52 PM
Is that your whole script? If so, it could be running so fast that none of script.Parent's children have loaded, which would mean you would be iterating over an empty table. Everything else looks fine though.
Report Abuse
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
10 Oct 2016 07:54 PM
@Insta

Yes, it is.
I'll try that.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
10 Oct 2016 07:55 PM
bump because i may have the same issue as the above poster mentioend that i wasn't able to solve


Report Abuse
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
10 Oct 2016 08:08 PM
Didn't work.
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
10 Oct 2016 08:42 PM
are clickdetectors added to the bricks?

it isn't a localscript right?



Report Abuse
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
11 Oct 2016 07:27 AM
There are click detectors added to the brick, and is a server script.
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
11 Oct 2016 08:19 AM
FilteringEnabled? If I remember correctly you might need a LocalScript to handle the ClickDetector.
Report Abuse
LockFocus is not online. LockFocus
Joined: 31 Aug 2013
Total Posts: 1044
11 Oct 2016 08:29 AM
No filtering enabled.
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