Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with this code? It says 'eof' expected near 'end'

foreverloop()

wait(1)

Script.Parent.CanCollide = false

Script.Parent.Transparency = 0.5

wait(1)

Script.Parent.CanCollide = true

Script.Parent.Transparency = 0

end

3 comments

0

That goes up and down

3

Edit your post to use Lua code formatting, and also maybe describe the problem a little more.

0

Well It says Eof expected near end when I put end

3 answers

is fine it means the engine is running correctly. and if you want to check your script, right click and go down and click "Check Script" and It will auto go to the Error. if it wont let you then you dont have a Error

1 comment

0

If it has ('end' Expected near "then") = put a end :P

There is no method named foreverloop(). A computer has no idea what this means, code must obey certain rules. The code below should work. Keep in mind while is accepted by lua as a loop that continues until the conditions between it and "do" are met, if you put true in the middle it will repeat forever unless something inside of it commands it to break.

while true do
	wait(1)
	script.Parent.CanCollide = false
	script.Parent.Transparency = 0.5
	wait(1)
	script.Parent.CanCollide = true
	script.Parent.Transparency = 0
end

PS: Don't capitalize Script when referring to the script the code is in.

Try this.

i = s
while i=s do
wait(1)
Script.Parent.CanCollide = false
Script.Parent.Transparency = 0.5
wait(1)
Script.Parent.CanCollide = true
Script.Parent.Transparency = 0

end

This discussion is preserved as it was. New answers, comments, and votes are closed.