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

3 comments
Remove the ")" right after "key".
ill try it thank you
that caused words used like 'Data' to become globally unknown