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

Data Store Error?

Asked by 8 years ago

This datastore is suppose to save weapons inserted into your starter gear. However im not sure the error and it is not working...

Here is the script:

local key = 'weps'  
local exclude = {  
    'GameMusicHuman, GameMusicInfected, LobbyMusic, CamControl, NoNames, ToggleFlashlight, ToggleSound'; 
}  

game.Players.PlayerAdded:connect( 
function(p) 
        local weps = data:GetAsync(p.userId..'_'..key) 
        if weps then 
            for _,v in pairs(weps) do 
                if game.ReplicatedStorage:FindFirstChild(v) then 
                    game.ReplicatedStorage[v]:clone().Parent = p.StarterGear 
                end  
            end 
        end  
        p.StarterGear.ChildAdded:connect( 
            function(c)  
                local tools = { } 
                for _,v in pairs(p.StarterGear:GetChildren()) do  
                    local add = true  
                    for _,c in pairs(excluded) do  
                        if v.Name ~= c.Name then 
                            add = false 
                        end 
                    end 
                    if add then 
                        table.insert(mo, v.Name) 
                    end 
                end 
                data:SetAsync(p.userId..'_'..key),  tools)  
            end 
        ) 
    end 
) 

Error occurs on line 30 with the "," right after "key)" And I don't know why Edit: It says it expected an identifier

1
Remove the ")" right after "key". grasheeno 70 — 8y
0
ill try it thank you CarterTheHippo 120 — 8y
0
that caused words used like 'Data' to become globally unknown CarterTheHippo 120 — 8y

Answer this question