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
 

I cant understand why i'm getting this error

Previous Thread :: Next Thread 
johnjohncar is not online. johnjohncar
Joined: 22 Aug 2012
Total Posts: 3557
05 Dec 2015 06:40 PM
Error: ')' expected (to close '(' at line 2) near 'elseif'

local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local JP = player:FindFirstChild("JumpPower")
local SP = player:FindFirstChild("SpeedPower")
local HP = player:FindFirstChild("Health")

if choice == script.Parent.Powerups.JumpPower then
if JP.Value < 4 then
local name = player.Name
local char = game.Workspace:FindFirstChild(name)
if char then
if JP.Value == 1 then
char.Humanoid.JumpPower = 75
JP.Value = JP.Value + 1
elseif JP.Value == 2 then
char.Humanoid.JumpPower = 100
JP.Value = JP.Value + 1
elseif JP.Value == 3 then
char.Humanoid.JumpPower = 130
JP.Value = JP.Value + 1
end
end
end
end
elseif choice == script.Parent.Powerups.JumpPower then
end
end)







der he is
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
05 Dec 2015 06:49 PM
Tab your code and this would be a breeze to find.

local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local JP = player:FindFirstChild("JumpPower")
local SP = player:FindFirstChild("SpeedPower")
local HP = player:FindFirstChild("Health")

if choice == script.Parent.Powerups.JumpPower then
if JP.Value < 4 then
local name = player.Name
local char = game.Workspace:FindFirstChild(name)
if char then
if JP.Value == 1 then
char.Humanoid.JumpPower = 75
JP.Value = JP.Value + 1
elseif JP.Value == 2 then
char.Humanoid.JumpPower = 100
JP.Value = JP.Value + 1
elseif JP.Value == 3 then
char.Humanoid.JumpPower = 130
JP.Value = JP.Value + 1
end
end
end
end
elseif choice == script.Parent.Powerups.JumpPower then
--pass
end
end
end)
Report Abuse
johnjohncar is not online. johnjohncar
Joined: 22 Aug 2012
Total Posts: 3557
05 Dec 2015 06:54 PM
Now its saying: Expected 'end' (to close 'function' at line 2), got 'elseif'



der he is
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
05 Dec 2015 07:02 PM
local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local JP = player:FindFirstChild("JumpPower")
local SP = player:FindFirstChild("SpeedPower")
local HP = player:FindFirstChild("Health")

if choice == script.Parent.Powerups.JumpPower then
if JP.Value < 4 then
local name = player.Name
local char = game.Workspace:FindFirstChild(name)
if char then
if JP.Value == 1 then
char.Humanoid.JumpPower = 75
JP.Value = JP.Value + 1
elseif JP.Value == 2 then
char.Humanoid.JumpPower = 100
JP.Value = JP.Value + 1
elseif JP.Value == 3 then
char.Humanoid.JumpPower = 130
JP.Value = JP.Value + 1
end
end
end
elseif choice == script.Parent.Powerups.JumpPower then
--pass
end
end
end)
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
05 Dec 2015 07:03 PM
gfd

local dialog = script.Parent
dialog.DialogChoiceSelected:connect(function(player, choice)
local JP = player:FindFirstChild("JumpPower")
local SP = player:FindFirstChild("SpeedPower")
local HP = player:FindFirstChild("Health")

if choice == script.Parent.Powerups.JumpPower then
if JP.Value < 4 then
local name = player.Name
local char = game.Workspace:FindFirstChild(name)
if char then
if JP.Value == 1 then
char.Humanoid.JumpPower = 75
JP.Value = JP.Value + 1
elseif JP.Value == 2 then
char.Humanoid.JumpPower = 100
JP.Value = JP.Value + 1
elseif JP.Value == 3 then
char.Humanoid.JumpPower = 130
JP.Value = JP.Value + 1
end
end
elseif choice == script.Parent.Powerups.JumpPower then
--pass
end
end
end)
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