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

im getting an error "expected end to close function at line 8 got eof" what am i doing wrong?

here is my code If you know what im doing wrong please tell me

local Tool = script.Parent


local event = Tool:WaitForChild("RemoteEvent")



event.OnClientEvent:connect(function(...)
	local tuple = {...}
	   local anim = Tool:FindFirstChild(tuple[2])
	    if anim and humanoid then
		local loadedanim = humanoid:LoadAnimation(anim)
		if loadedanim then 
			loadedanim:Play()
			if themouse then 
				themouse.Icon = "rbxasset;//textures\\GunWaitCursor.png"
				wait(1)
				themouse.Icon = "rbxasset;//textures\\GunCursor.png"
                 end
			end
		end
	
		
Tool.Equiped:connect(function(mouse)
	themouse = mouse 
	humanoid = Tool.Parent:FindFirstChild("Humanoid")
	if humanoid then
		 local anim = Tool:FindFirstChild("IdleAnim3")
	    if anim and humanoid then
			if loadedidleanim then
				loadedidleanim:Stop()
			end
		 loadedIdleanim = humanoid:LoadAnimation(anim)
		if  loadedIdleanim then 
			 loadedIdleanim:Play()
			end
	    end
	end
	if themouse then
		themouse.Icon = "rbxasset;//textures\\GunCursor.png"
		 end 
	end)

Tool.Unequipped:connect(function()
	if loadedIdleanim then
		loadedIdleanim:Stop()
		end
	end)

2 answers

✓ Accepted answer

You're missing a end) at line 22

1 comment

0

Thank you so much!

You're missing a lot of ends there buddy. For every if you need an end, and for every connect(function() you need an end).

1 comment

0

He's not really missing that many ends if you count them, they're just really odly placed, not like normal format

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