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: Stupid 'end' expected near 'else' thing! So Annoying!

Previous Thread :: Next Thread 
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 11:53 AM
How do I deal with this??? I see it all the time! 'end' expected near 'else'
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
14 May 2014 11:54 AM
thnks for giving us the code
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
14 May 2014 11:54 AM
how are we supposed to know if you dont give us the script.

Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 May 2014 11:55 AM
if statement then
--code
else
--code
--oops forgot an end right here..
end

or something,your missing an end is the point..
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 11:56 AM
it doesnt matter wat the script is :p even if I said
function onClick(Clicked)
if lalala == lalala then
Frame.Visible = true
else
Frame.Visible = false

script.Parent.Button1Click:connect(onClick)

that was just an example... it happens with everything!
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
14 May 2014 11:57 AM
*facedesk*
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
14 May 2014 11:57 AM
function onClick(Clicked)
if lalala == lalala then
Frame.Visible = true
else
Frame.Visible = false
FKING END HERE

script.Parent.Button1Click:connect(onClick)
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 11:57 AM
islandmaker, thats wwat I tried doing, and no matter were I put the ends or how much, it doesnt work :/
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
14 May 2014 11:58 AM
give us your script then you tool.

Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 11:58 AM
wazap, I already have an end there, no matter how many I put its useless :p
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 May 2014 11:58 AM
function onClick(Clicked)

if lalala == lalala then
Frame.Visible = true
else
Frame.Visible = false
end

end
--END
--GOES
--THERE
--END TO END THE IF STATEMENT
--END TO END THE FUNCTION


script.Parent.Button1Click:connect(onClick)
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
14 May 2014 11:59 AM
rusrs


function onClick(Clicked)
if lalala == lalala then
Frame.Visible = true
else
Frame.Visible = false
end
end

script.Parent.Button1Click:connect(onClick)

gg no re
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 May 2014 12:00 PM
@wazap
I don't usually ask ppl to come to my thread via other threads but..
no one is replying

Ive never used bodythrust and..
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 12:01 PM
k, here's my script, but sry, I cant give away my Plans so I'll rename the important names...

Name = script.Parent.Parent.Name
Name1 = script.Parent.Parent.Parent.Name1

function OnClick(Clicked)
if Name1:GetChildren()>0 then
Name1:ClearAllChildren()
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
else
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end

script.Parent.MouseButton1Click:connect(OnClick)
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
14 May 2014 12:01 PM
you're missing so many ends.

Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 12:02 PM
yeah but I tried adding them, I added like 30 ends and it didnt work :p
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 May 2014 12:03 PM
for loop
--needs an end
function
--needs an end
if statement
--needs an end

Name = script.Parent.Parent.Name
Name1 = script.Parent.Parent.Parent.Name1

function OnClick(Clicked)--needs an enddddd
if Name1:GetChildren()>0 then--needs an endddd
Name1:ClearAllChildren()
local children = Name:GetChildren()

for i = 1, #children do
children[i]:clone().Parent = Name1
end--end here,of the for loop

else

local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end--end of for loop
end--end of if statement
end--end of function
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
14 May 2014 12:05 PM
if condition then

else

end

*facebrick*
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 12:07 PM
islandmaker, just tried it, doesnt work D:
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
14 May 2014 12:10 PM
Heres a suggestion
For every if/for/while statement you create, add a tab to the next line

For each tab you add, you need an end after that

For example (pretend the ... is a tab):

function onTouched(hit)
...if hit.Parent:findFirstChild("Humanoid") then
......if not hit.Parent:findFirstChild("LavaArmor") then -- Just an example :P
.........hit.Parent.Humanoid.Health = 0
......end
...end
end

script.Parent.Touched:connect(onTouched)
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
14 May 2014 12:11 PM
function OnClick(Clicked)
if Name1:GetChildren()>0 then
Name1:ClearAllChildren()
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end
else
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end
end

script.Parent.MouseButton1Click:connect(OnClick)
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 12:13 PM
lol sry clone, but am confused... am so tired, didnt sleep for ages and just came back from school sleepy so am confused... lol sry
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
14 May 2014 12:14 PM
@de
your missing the end of function


function OnClick(Clicked)
if Name1:GetChildren()>0 then
Name1:ClearAllChildren()
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end
else
local children = Name:GetChildren()
for i = 1, #children do
children[i]:clone().Parent = Name1
end
end
end
Report Abuse
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
14 May 2014 12:15 PM
despizer, are u 100% sure about that? cos I dont think its a food idea to 'end' if the script still has to run the things below, but a well... I'll try stick with that then...
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
14 May 2014 12:15 PM
Think of it as like a system of layers.

For every layer you create, you have to end it as well. The Tab key is the key found above the caps lock key. Its a single key that is 5 spaces long, and you can use that to organize what block you are on and how many ends you need.
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