Hello! This is my first post on the developer forum, I haven’t had trouble putting in multiple strings into a datastore (I used print to find this out) but I cannot pull more than one out.
Please don’t try to tell me my system sucks I like it the way it is
What the system does
I have a Star Wars game, I use lightsabers made by SolarHorizon, people can choose whatever color they want, which is why I made a system that only allows them to use certain colors, with boolvalues.
A player selects from one of these,
and fires to the server using the following:
local function Select() for i, v in next, svals:GetChildren() do if v.Value == true then event:FireServer(tostring(v.Name)) source:Destroy() print(v) end end end source.Fire.MouseButton1Click:Connect(Select)
(When a person selects a button the “sval” with the same name as the button becomes true
and then this is the server side
local function addCrystal(plr, info) datastore:SetAsync(plr.UserId, info) plr.Settings[info].Value = true end local function AddCurrents(plr) for _, v in next, plr.Settings:GetChildren() do local data = datastore:GetAsync(plr.UserId) if v.Name == tostring(data) then v.Value = true end end end
When I try to use all of the colors I selected, only one of the values is true. Anyone know what the problem is besides me having terrible scripting abilities?