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

I'm making a new emote tool,expected <eof> got 'end'???

I managed to fix it. But more errors appear.




enabled = false

script.Parent.Equipped:connect(function(m)

	m.Button1Down:connect(function()
		
		local hum = game.Players.LocalPlayer.Character.Humanoid
		local anim_feet = hum:LoadAnimation(script.Parent.Animation)
		local current = anim_feet
		
		
	
if enabled == false then
	

	
	
	current:Play()
	script.Parent.Sound:Play()
	hum.WalkSpeed = 0
	enabled = true
	
	
	
	

else
	current:Stop()
	current:Destroy()
	script.Parent.Sound:Stop()
	hum.WalkSpeed = 16
	
end
end)
		
		
		
		
		

		
		
		
		
		
		
	
		
script.Parent.Unequipped:connect(function()
	
	script.Parent.Sound:Stop()
	current:Stop()
	
	
	hum.WalkSpeed = (16)
	


end)
	end)
end)





1 comment

0

the last end is the error

2 answers

you have a extra end)

2 comments

0

but when i take the extra end) away, it thinks that 'current' is not a valid value

0

It's because you're using the local current in another separate function, also you have an extra end)

enabled = false

script.Parent.Equipped:connect(function(m)

	m.Button1Down:connect(function()

	        local hum = game.Players.LocalPlayer.Character.Humanoid
	        local anim_feet = hum:LoadAnimation(script.Parent.Animation)
	        local current = anim_feet

		if enabled == false then

		    current:Play()
		    script.Parent.Sound:Play()
		    hum.WalkSpeed = 0
		    enabled = true

		else

			current:Stop()
			current:Destroy()
			script.Parent.Sound:Stop()
			hum.WalkSpeed = 16
 
		end --if end
	end) -- function mousebutton end
end) -- end the eppuiped part


script.Parent.Unequipped:connect(function()
 
	script.Parent.Sound:Stop()
	current:Stop()
 
 
	hum.WalkSpeed = (16)

end) -- only 1 end for Unequipped. then are no if's or functions to end
   

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