game.Players.PlayerAdded:connect(function(plr)
local shop = plr.PlayerGui:WaitForChild("SHOP")
local DaggerB = shop.Frame.Weapons.Dagger
local DaggerBtext = DaggerB:WaitForChild("Info").Text
local DaggerOwned = DaggerB:WaitForChild("Owned")
DaggerOwned.Value = DaggerDS:GetAsync(Id) or false
print("Dagger Owned = "..DaggerOwned.Value)
end)
error Error attempt to concatenate field 'Value' (a boolean value)
i need this for a data store.
--if you can be bothered to read it--
local DS = game:GetService("DataStoreService")
local DaggerDS = DS:GetDataStore("DaggerDS")
game.Players.PlayerAdded:connect(function(plr)
local shop = plr.PlayerGui:WaitForChild("SHOP")
local DaggerB = shop.Frame.Weapons.Dagger
local DaggerBtext = DaggerB:WaitForChild("Info").Text
local DaggerOwned = DaggerB:WaitForChild("Owned")
local Id = plr.UserId
DaggerOwned.Value = DaggerDS:GetAsync(Id) or false
print("Dagger Owned = "..DaggerOwned.Value)
if DaggerOwned.Value == false then
DaggerBtext = "Price: 0"
else
DaggerBtext = "OWNED"
end
DaggerOwned.Changed:Connect(function()
DaggerDS:SetAsync(Id, DaggerOwned.Value)
print(DaggerOwned.Value)
end)
end)
