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
 

Re: I need help

Previous Thread :: Next Thread 
Predator205660 is not online. Predator205660
Joined: 26 Jul 2011
Total Posts: 3757
13 Dec 2013 06:54 PM
I want to make a script that, plays a background theme while in my menu but if the player clicks "PLAY" then the background theme will stop and scriptone and scripttwo will start to play the game's main music.

So Far I have:

while true do
game.Workspace.soundfour:Play()
wait(15)
end

if script.Parent.MouseButton1Down:connect then
game.Workspace.soundfour:Remove
wait(5)
game.Worksapce.scripttwo.Disabled=false
and
game.Worksapce.scriptone.Disabled=false
end



I know it doesn't make sense but I need help.
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
13 Dec 2013 06:55 PM
game.Workspace.soundfour:Remove
to
game.Workspace.soundfour:Remove()
Report Abuse
Predator205660 is not online. Predator205660
Joined: 26 Jul 2011
Total Posts: 3757
13 Dec 2013 06:58 PM
Woops careless error. Thanks.

Now I know the line:
if script.Parent.MouseButton1Down:connect then
Doesn't make sense but I want a function to happen when the parent of script is clicked.
Report Abuse
Eclipsin is not online. Eclipsin
Joined: 09 Feb 2012
Total Posts: 5197
13 Dec 2013 07:03 PM
Change that second group of lines to this:

function onClick()
game.Workspace.soundfour:Remove()
wait(5)
game.Worksapce.scripttwo.Disabled=false
and
game.Worksapce.scriptone.Disabled=false
end

script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
wuzzy33 is not online. wuzzy33
Joined: 28 Jul 2012
Total Posts: 69
13 Dec 2013 07:06 PM
I need help too I need a camera for my game its sort of like a cutscene and yeah I also need a CarBuy button but I'm not BC so I can't build cars Ive tried many things but they never work can someone help me?
Report Abuse
Predator205660 is not online. Predator205660
Joined: 26 Jul 2011
Total Posts: 3757
13 Dec 2013 07:20 PM
while true do
game.Workspace.soundfour:Play()
wait(15)
end

function onClick()
game.Workspace.soundfour:Remove()
wait(5)
game.Workspace.scripttwo.Disabled=false
and
game.Workspace.scriptone.Disabled=false <----says theres an unexpected symbol near "="
end

script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
Slywarp is not online. Slywarp
Joined: 12 Jul 2012
Total Posts: 8
13 Dec 2013 07:42 PM
The and operator only works for booleans, usage:

if a and b then

Only if both a and b are true will the if statement work. Your code should be:

while true do
game.Workspace.soundfour:Play()
wait(15)
end

function onClick()
game.Workspace.soundfour:Remove()
wait(5)
game.Workspace.scripttwo.Disabled = false
game.Workspace.scriptone.Disabled = false
end

script.Parent.MouseButton1Down:connect(onClick)

No and needed. It could also be:

while true do
game.Workspace.soundfour:Play()
wait(15)
end

function onClick()
game.Workspace.soundfour:Remove()
wait(5)
game.Workspace.scripttwo.Disabled, game.Workspace.scriptone.Disabled = false, false
end

script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
Predator205660 is not online. Predator205660
Joined: 26 Jul 2011
Total Posts: 3757
13 Dec 2013 08:03 PM
scriptone's Disabled Boolean is the one that doesn't work? Because scripttwo's Disables Boolean works fine.
Report Abuse
Slywarp is not online. Slywarp
Joined: 12 Jul 2012
Total Posts: 8
13 Dec 2013 08:11 PM
No, it's not the booleans themselves, it's the syntax in which you set them. You don't need an and in there.
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