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 data store almost works 100%, it gets to a points where an error occurs in identification.

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 
) 


On line '30' the error on output says "Workspace.DataStore:30: unexpected symbol near ','"

And Removing the ")" right after "key" will not work.

0
data:SetAsync((p.userId..'_'..key), tools) Slazerick 55 — 8y

Answer this question