#It expected end, it got end from what i see but its not happy

6 messages · Page 1 of 1 (latest)

azure jungle
#

ServerScriptService.CoreScript (Server):44: Expected 'end' (to close 'function' at line 8), got 'elseif'; did you forget to close 'then' at line 35? I just keep getting this error and I have no clue what to do

oreevent.OnServerEvent:Connect(function(plr, eventtype, Arg1)
(not relevant)

for i,v in pairs(characters:GetChildren()) do
            local CharacterName = Arg1
            if v.Name == CharacterName and not v:FindFirstChild("GamepassId") then
                plr.CurrentCharacter.Value = CharacterName
            elseif v.Name == CharacterName and v:FindFirstChild("GamepassId") and mps:UserOwnsGamePassAsync(plr.UserId, v.GamePassId.Value) then
                plr.CurrentCharacter.Value = CharacterName
            end
        end
        local CharacterName = Arg1
        if characters[CharacterName]:FindFirstChild("Weapon") then
            coreevent:FireClient(plr, "ToolbarDisable")
            
            local weapon = characters[CharacterName].Weapon:Clone()
            weapon.Parent = plr.Character
            
            
        end
    end
elseif eventtype == "Skill" then
    local SkillNumber = Arg1
    
    if plr.CurrentCharacter.Value == "Gojo" then
        CombatModule.Gojo(plr, SkillNumber)
    elseif plr.CurrentCharacter.Value == "Toji" then
        CombatModule.Toji(plr, SkillNumber)
    elseif plr.CurrentCharacter.Value == "Yuji" then
        CombatModule.Yuji(plr, SkillNumber)
    end
end

end)

#

coreevent is what it is btw, discord cut it off

small bridge
#

Don’t else and if have to be 2 different things??

covert caveBOT
#

studio** You are now Level 1! **studio

small bridge
#

Cause the error is talking about the first if and how it technically doesn’t end because of the elseif

#

I think I might be wrong