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: This script won't work, please help.

Previous Thread :: Next Thread 
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 06:36 PM
local buzz = Workspace.Buzzing

function onTouch(hit)
while true do

buzz:Play
wait(0.5)

end
end





What did I do wrong?
Report Abuse
brandon881534 is not online. brandon881534
Joined: 13 May 2010
Total Posts: 3267
13 Oct 2013 06:38 PM
I think you need one more end that goes like this
(Continued from what you said)
end
end
end)
Now can I have a cookie? :3
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 06:39 PM
@brandon

It didn't say I needed another one.
Report Abuse
FoggedOut is not online. FoggedOut
Joined: 09 Dec 2011
Total Posts: 3021
13 Oct 2013 06:40 PM
'buzz:Play'

If its a sound, its actually buzz:Play()
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
13 Oct 2013 06:41 PM
@fogged
:player and :Play are the same. It doesn't make a difference.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
13 Oct 2013 06:42 PM
Disregard my post. I made a fail typo and didn't read his post correctly. I thought he said that ":play()" should be ":Play()".

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 06:42 PM
I'm sorry, I did add the "()."

This is the exact script from RS, not my memory.

local buzz = Workspace.Buzzing

while true do
function onTouch(hit)

buzz:Play()
wait(1)

end
end
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 07:09 PM
Bump.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
13 Oct 2013 07:12 PM
That script is completely wrong. There's hardly a snippet of correct code. Explain what you want to happen.

~ℇℸℇℛηαℒℱίℛℇℇαℸℇℛ~
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 07:19 PM
@Eternal

There is an invisible brick. I want it to play a sound when it is touched.
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 07:35 PM
Bump.
Report Abuse
qrrrq is not online. qrrrq
Joined: 27 Jan 2013
Total Posts: 1252
13 Oct 2013 07:38 PM
1.) The while loop needs to be after the function
2.) You never called the function
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 07:46 PM
@qrrrq

How do I "call the function?"
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 08:00 PM
Bump.
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
13 Oct 2013 08:04 PM
Put this script in the invisible Brick

local buzz = game.Workspace.Buzzing
local brick = script.Parent

function onTouch(hit)

buzz:Play
wait(0.5)

end

brick.Touched:connect(onTouch)

Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 08:10 PM
@Grove

Thank you so much!
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
13 Oct 2013 08:11 PM
Np :)
and when you use functions you always have to add that last line I put with the :connect
It's so the script knows when to start that function :) You can look up more types of connections in the wiki
Report Abuse
MudpieeipduM123 is not online. MudpieeipduM123
Joined: 18 Jul 2011
Total Posts: 3573
13 Oct 2013 08:19 PM
Erm...


function arguments expected near "wait"
Report Abuse
Grove537 is not online. Grove537
Joined: 05 Feb 2010
Total Posts: 3478
13 Oct 2013 08:22 PM
buzz = game.Workspace.Buzzing
brick = script.Parent

function onTouch()

buzz:Play
wait(0.5)

end

brick.Touched:connect(onTouch)

Maybe try this?
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