Why is this error coming up when I run my code? And how can I stop it?
Asked by
4 years ago Edited 4 years ago
I keep on getting this error when I run this code, but I have no idea why.
01 | Move.OnServerEvent:Connect( function (person, key, Value, MouseValue) |
02 | print (Value, CanMove 1 , grounded) |
03 | if Value = = true and CanMove 1 = = true and grounded = = false then |
07 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
09 | print ( "Should be true" ) |
12 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
16 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
20 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
22 | end if key = = Space then |
24 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
27 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
29 | function spawnman(person) |
31 | elseif Value = = false then |
41 | if key = = "Mouse" then |
43 | Name = game.Workspace:WaitForChild(person.name.. "Tempman" ) |
46 | local Var 2 = Name.Union.Orientation + one |
47 | Name.Union.Orientation = Var 2 |
50 | Name.Head.Orientation = Vector 3. new(MouseValue.Y * - 80 , 0 , 0 ) + Name.Union.Orientation |
52 | Name.Focus.CFrame = Name.Head.CFrame * CFrame.new( 4 , 2.5 , 6 ) |
54 | Name.Neck.Orientation = Name.Union.Orientation |
56 | one = Vector 3. new( 0 ,MouseValue.X * - 85 + 180 , 0 ) - Name.Union.Orientation |
The error is on the last end. Here is the error
ServerScriptService.Spawn/Move:197: Expected 'end' (to close 'function' at line 129), got <eof>; did you forget to close 'then' at line 169?