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

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

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)

3 comments

0

i have an awnser but i have to wait 1.5 minutes to post another awnser to a question

0

thx ill wait

0

heyy

1 answer

✓ Accepted answer

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.

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