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

im trying to make a elevator script but i keep running into this error anyone know a fix?

heres the code:

ewx,ewy,ewz = 1.5,6.5,34
ewx2,ewy2,ewz2 = 7,6.5,28.5
ewx3,ewy3,ewz3 = 0.5,6.5,25
erx,ery,erz = 1.5,11.5,29.5
egx,egy,egz = 1.5,1.5,29.5

time = 0.1
ev1 = workspace.elevatorwall
ev2 = workspace.elevatorwall2
ev3 = workspace.elevatorwall3
er = workspace.elevatorroof
eg = workspace.elevatorground


function elevator()
	repeat
	ev1.CFrame = CFrame.new(ewx,ewy,ewz)
		ewy = ewy + 1
		ev2.CFrame = CFrame.new(ewx2,ewy2,ewz2)
		ewy2 = ewy2 + 1
		ev3.CFrame = CFrame.new(ewx3,ewy3,ewz3)
		ewy3 = ewy3 + 1
		er.CFrame = CFrame.new(erx,ery,erz)
		ery = ery + 1
		eg.CFrame = CFrame.new(egx,egy,egz)
		egy = egy + 1
		wait(time)
		
		
	until workspace.elevatorground.CFrame == (1.5,60.5,29.5)
	
	
		
end
script.Parent.MouseButton1Click:connect(elevator)

heres the error

01:27:58.614 - Workspace.screen.SurfaceGui.leviosa.Script:30: ')' expected near ','

2 comments

0

Have you taken a look as using a PrismaticConstraint as it will be good for this task.

0

also it would be even simpler to make it by adapting the script from the video on YT by Roblox called "how to make a moving platform" as it would require very little scripting

1 answer

✓ Accepted answer

Syntax Error

Basically, you've made a mistake on line 30, and I can see what it is. You've basically put some characters in the wrong place.


CFrame

Your until line is off. You were correct until you were stating the measurements. Why? You need to add CFrame.new infront of your brackets. That should fix it.

Read more at the wiki


Fixed script

Here is your fixed script!

ewx,ewy,ewz = 1.5,6.5,34
ewx2,ewy2,ewz2 = 7,6.5,28.5
ewx3,ewy3,ewz3 = 0.5,6.5,25
erx,ery,erz = 1.5,11.5,29.5
egx,egy,egz = 1.5,1.5,29.5

time = 0.1
ev1 = workspace.elevatorwall
ev2 = workspace.elevatorwall2
ev3 = workspace.elevatorwall3
er = workspace.elevatorroof
eg = workspace.elevatorground


function elevator()
    repeat
    ev1.CFrame = CFrame.new(ewx,ewy,ewz)
        ewy = ewy + 1
        ev2.CFrame = CFrame.new(ewx2,ewy2,ewz2)
        ewy2 = ewy2 + 1
        ev3.CFrame = CFrame.new(ewx3,ewy3,ewz3)
        ewy3 = ewy3 + 1
        er.CFrame = CFrame.new(erx,ery,erz)
        ery = ery + 1
        eg.CFrame = CFrame.new(egx,egy,egz)
        egy = egy + 1
        wait(time)


    until workspace.elevatorground.CFrame == CFrame.new(1.5,60.5,29.5)



end
script.Parent.MouseButton1Click:connect(elevator)

Thanks for reading

Thanks for reading my answer. If it helped, make sure to upvote it or set it as the answer.

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