Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

help me with my code, someone? error expected identifier got '')"

Asked by 6 years ago
Edited 6 years ago
game.StarterPlayer.EnableMouseLockOption = false

    local UserInpServ = game:GetService('UserInputService') 
    local ReplicatedStorage = game:GetService('ReplicatedStorage') 

            UserInpServ.InputBegan:Connect(function(Input)
                if Input.KeyCode == Enum.KeyCode.LeftShift then 
                    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 99
                end
                if Input.KeyCode == Enum.KeyCode.Q then 
                    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 5 
                else if Input.KeyCode == Enum.KeyCode.Q then 
                    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 15 
                end
            end)


            UserInpServ.InputEnded:Connect(function(Input)
                if Input.KeyCode == Enum.KeyCode.LeftShift then
                    game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 15
                end
            end)
0
i have an awnser but i have to wait 1.5 minutes to post another awnser to a question User#20192 0 — 6y
0
thx ill wait Cropins 2 — 6y
0
heyy Cropins 2 — 6y

1 answer

Log in to vote
2
Answered by
T0XN 276 Moderation Voter
6 years ago
Edited 5 years ago

You added a space in between else and if, which looks like you have an extra if statement. Thus, the error you have is expecting an end. The correct keyword is elseif, not else if.

Ad

Answer this question