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: else problem

Previous Thread :: Next Thread 
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
12 Mar 2017 06:11 PM
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.GunValues.M4.Value == true then
if script.Parent.Parent.CamoValues.Teal.Value == true then do
gun = game.ReplicatedStorage.Gun.TealM4:Clone()
gun.Parent = script.Parent.Parent.Parent.Parent.Backpack
script.Parent.Visible = false
local player = game.Players.LocalPlayer
player.Character.Humanoid.TealM4:remove()
-------------------regM4
else if script.Parent.Parent.GunValues.M4.Value == true then
if script.Parent.Parent.CamoValues.Black.Value == true then do
gun = game.ReplicatedStorage.Gun.M4:Clone()
gun.Parent = script.Parent.Parent.Parent.Parent.Backpack
script.Parent.Visible = false
local player = game.Players.LocalPlayer
player.Character.Humanoid.M4:remove()

end end
end
end
end)

Players.Player1.PlayerGui.Menu.Spawn.LocalScript:10: 'end' expected (to close 'do' at line 3) near 'else'
16:11:01.545 - Unable to load plugin icon.
Report Abuse
Fredfishy is not online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
12 Mar 2017 07:07 PM
Don't you have a random "do" on this line?

" if script.Parent.Parent.CamoValues.Black.Value == true then do"
Report Abuse
starlord1332 is not online. starlord1332
Joined: 14 Jul 2014
Total Posts: 67
12 Mar 2017 10:56 PM
No space between else and if.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Mar 2017 10:58 PM
"Don't you have a random "do" on this line?"

No. The `do` keyword declares a new scope.


Report Abuse
doggy00 is online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
12 Mar 2017 11:10 PM
I'm kinda lazy right now but try adding 'end' right before the last end?
Report Abuse
starlord1332 is not online. starlord1332
Joined: 14 Jul 2014
Total Posts: 67
12 Mar 2017 11:13 PM
The script is so messy. There are even t so ends on the same line.
Report Abuse
starlord1332 is not online. starlord1332
Joined: 14 Jul 2014
Total Posts: 67
12 Mar 2017 11:13 PM
t wo*
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Mar 2017 11:14 PM
Some people prefer that look. I honestly don't understand it.


Report Abuse
doggy00 is online. doggy00
Joined: 11 Jan 2011
Total Posts: 3571
12 Mar 2017 11:15 PM
If anything it's sloppy because it has == true in an if then statement but I'm even sloppier than that so I can't really say anything.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Mar 2017 11:17 PM
That's not even considered sloppy. It's preference in many cases because the performance difference between evaluating the value alone in a condition and comparing the value to true is generally negligible.


Report Abuse
starlord1332 is not online. starlord1332
Joined: 14 Jul 2014
Total Posts: 67
12 Mar 2017 11:18 PM
Well my scripts are not sloppy...

Because I have none. Right now I only have a lobby.
Well... at least my active game.
Report Abuse
loomis0523BC is not online. loomis0523BC
Joined: 08 Jan 2015
Total Posts: 764
14 Mar 2017 10:33 PM
i fixed it
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