local BoomBux = game.Players.LocalPlayer.leaderstats.BoomBux
local text = script.Parent.Frame
local packs = game.Players.LocalPlayer.leaderstats.BackPacks:GetChildren()
for i,backpacks in pairs(packs) do
while wait(0.1) do
if backpacks.Purchased.Value == true then
if backpacks.Equipt.Value == true then
local currentpack = backpacks
text.Text = BoomBux.Value .. "/" .. backpacks.Storage.Value
end
end
end
end
game.ReplicatedStorage.Remotes.PackFull.OnClientEvent:Connect(function()
print("e")
script.Parent.Frame:TweenPosition(UDim2.new(0.3, 0,0.6, 0),Enum.EasingDirection.In,Enum.EasingStyle.Circular,0.5)
end)
I cant put it in the StarterPlayerScripts because of
local text = script.Parent.Frame
I also get this error when it is in StarterPlayerScripts
local packs = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("BackPacks"):GetChildren()
Also, @Voliiqs is right that it needs to be in a specific place where LocalScripts run. LocalScripts only work in certain locations as of a update a while back.
I haven’t done this much myself either. However, I do know for a fact that you can not access the player leaderboard from a local script. A leaderboard is server oriented.
Of course it’s meant to be Server oriented. You couldn’t edit the value of the IntValue on anything but your own client, but can you view the values that are replicated from the server? I will test this out later.
The remote function you suggested is a good solution regardless.