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: Functions with loops in them, and endings "end)"

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Oct 2013 09:38 PM
I looked in output, cant figure it wout, please help. I want it so if someone chats Rocket Launcher" then it gives em it.

game.Players.PlayerAdded:connect(function(player)-- Do the following every time a player joins
player.Chatted:connect(function(msg)
if message == "Rocket Launcher" then
while wait(5) do --makes a loop
c = game.Players:GetChildren() -- defines 'c' as all the players in the game
for i =1,#c do -- for every player do...
debounce = false -- Works AS many times as you want
if c[i].Backpack:FindFirstChild("Rocket Launcher") == nil -- If rocket launcher = nil
and debounce == false then -- If you get as many as want then
debounce = true --Make it so u cant get as many
-- if there is no sword in the backpack then
game.Lighting:FindFirstChild("Rocket Launcher"):Clone().Parent = c[i].Backpack -- put a Rocket Launcher (I hope) into the backpack
else break
end))
end
end
end
end
end
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Oct 2013 09:47 PM
Help me!
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Oct 2013 09:48 PM
Output:

Workspace.Rocket Launder:16: unexpected symbol near ')'
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
29 Oct 2013 09:49 PM
They're supposed to match up with the unclosed '('s up in the first two lines.

game.Players.PlayerAdded:connect(function(player)-- Do the following every time a player joins
player.Chatted:connect(function(msg)
if message == "Rocket Launcher" then
while wait(5) do --makes a loop
c = game.Players:GetChildren() -- defines 'c' as all the players in the game
for i =1,#c do -- for every player do...
debounce = false -- Works AS many times as you want
if c[i].Backpack:FindFirstChild("Rocket Launcher") == nil -- If rocket launcher = nil
and debounce == false then -- If you get as many as want then
debounce = true --Make it so u cant get as many
-- if there is no sword in the backpack then
game.Lighting:FindFirstChild("Rocket Launcher"):Clone().Parent = c[i].Backpack -- put a Rocket Launcher (I hope) into the backpack
else
break
end
end
end
end
end)
end)
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
29 Oct 2013 10:27 PM
If msg =9 "Rocket Launcher" then
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
29 Oct 2013 10:43 PM
Oh, and above is right.
(He meant to say - if msg == "Rocket Launcher" then -)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
29 Oct 2013 10:56 PM
thank. what about the ends?
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