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: How to use functions and manipulate properties in a bool?

Previous Thread :: Next Thread 
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:00 AM
So, I'm a total noob at scripting and I want to know how to use functions in a bool (probably not the right term to use lol), for example, if I want a property to change when a event/function occurs.

In this case, I'm trying to make it so that a smoke object's "enabled" property will be activated if a sound plays, and this is all registered under a clickdetector. This is what I have so far.

local smoke = Inst#####################o##############alse
smoke.parent = game.Workspace.cannon.barrel

local sound = Instance.new ("Sound")
sound.SoundId = "eedoesntmatterrr"
sound.parent = game.workspace.cannon.barrel

barrel = script.Parent


function shoot()

if sound:Play = true then
smoke.Enabled = true
else
smoke.Enabled = false
end
end

barrel.ClickDetector.MouseClick:connect(shoot)


Yeah, make fun of me if you want if it's a horrendous failure :P

But, how would I actually do this, since what might be the problem is how I registered the smoke, and also how I used the sound:Play



Report Abuse
Deranged_User is not online. Deranged_User
Joined: 14 Sep 2008
Total Posts: 1122
26 Mar 2017 09:02 AM
whenever sound is changed, and is playing, you simply add smoke to it.
Report Abuse
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:05 AM
Censoring won't let the first part in..

Let's just change "smoke" to "bunnies"

local bunnies = Instance.new("Bunnies")
Bunnies.enabled = false
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
26 Mar 2017 09:06 AM
sound.Changed:connect(function()
if sound.Playing then

end
end)


capitalist atheist
Report Abuse
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:07 AM
######### Like I said, I'm new so I'm not entirely sure how to do that, sorry Can you give me a sample of the script or something
Report Abuse
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:08 AM
I'll try that, thanks
Report Abuse
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:08 AM
^ ####
Report Abuse
ultrasonicboomer is online. ultrasonicboomer
Joined: 01 Jan 2012
Total Posts: 641
26 Mar 2017 09:19 AM
Still not working, I think I didn't register smoke.Enabled the way I should
Report Abuse
DarknessSheath is not online. DarknessSheath
Joined: 07 Sep 2014
Total Posts: 255
26 Mar 2017 09:22 AM
> sound.parent
sound.Parent
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