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

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by 4 years ago

You're missing a end) at line 22

0
Thank you so much! Skinnygrowler 6 — 4y
Ad
Log in to vote
1
Answered by 4 years ago

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).

0
He's not really missing that many ends if you count them, they're just really odly placed, not like normal format PureLiteStudio 80 — 4y

Answer this question