Ok so my shop is finally working yeah! But we have a problem with adding money to people, instead of it using leaderstats as a way (this is so hackers can't hack they stats) to change it uses a Folder in ServerScriptServices called Players and it adds new Folders with their Username with the stat inside but I have no idea how to locate that from a script so it can change. Here's the script I'm trying to change my leaderboard money with.
local time = 180 while true do wait(1) time = time - 1 if (time <= 0) then time = 180 players = game.Players:GetChildren() for i=1, #players do if (players[i]~=nil) then if (players[i]:findFirstChild("leaderstats")) then if (players[i].leaderstats:findFirstChild("Credits")) then if (players[i]:IsInGroup(234707)==true) then -- user IS in ERR players[i].leaderstats.Credits.Value = players[i].leaderstats.Credits.Value + 50 if (players[i]:IsInGroup(234706)==true) then -- Guard players[i].leaderstats.Credits.Value = players[i].leaderstats.Credits.Value + 30 end else players[i].leaderstats.Credits.Value = players[i].leaderstats.Credits.Value + 50 end end end end end end playersa = game.Players:GetChildren() for i=1, #playersa do if (playersa[i]~=nil) then if (playersa[i]:findFirstChild("PlayerGui")) then if (playersa[i].PlayerGui:findFirstChild("PaydayGui")) then playersa[i].PlayerGui.PaydayGui.Label.Text = "Next payday in: " .. tostring(time) .. " seconds" end end end end end
All you have to do is change the source
of where you're editing the stats, silly. It's on lines 14,16,and 19
I edited some other stuff too for efficiency(;
local time = 180 while wait(1) do time = time - 1 if (time <= 0) then time = 180 end for i,v in pairs(game.Players:GetPlayers()) do --different source directory local plr = game.ServerScriptStorage.Players:FindFirstChild(v.Name) if plr then --edit-- local gui = v.PlayerGui:FindFirstChild('PaydayGui') --edit-- local creds = plr.Credits if gui then gui.Label.Text = 'Next payday in '..time..' seconds' end if plr:IsInGroup(234707) then creds.Value = creds.Value + 50 elseif plr:IsInGroup(234706) then creds.Value = creds.Value + 30 end creds.Value = creds.Value + 50 end end end
Locked by Goulstem, NinjoOnline, and M39a9am3R
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?