Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Leaderstat script works well in Studio, but not ingame? (HELP)

Asked by 6 years ago

This is the sixth time I've posted this. Scripting Helpers, you are not making a good first impression on me by making me post a post ******six****** times and not receive a correct answer. Anyway, this is one of my scripts. It is supposed to take the value of Videos and add it to Views every 120 seconds. It works in Studio, but not in my Roblox game. On my last post, my script was edited by another user and now I see ABSOLUTELY no reason why this shouldn't work. The subscribers value is under 10, before you ask. Here is the script:

while wait(120) do
for _,Player in pairs(game.Players:GetChildren()) do
local leaderstats = Player:WaitForChild("leaderstats")
local subs = leaderstats:WaitForChild("Subscribers")
local Views = leaderstats:WaitForChild("Views")
local Videos = leaderstats:WaitForChild("Videos")
local num = 10
if subs.Value <= num then
Views.Value = Views.Value + Videos.Value
end
end
end
0
Are you getting any errors in the dev console (F9) when you run this in a published game? If you add some print statements to display the values of subs.Value, views.Value etc and run it in a published game, what do you see in the dev console? vector3_zero 1056 — 6y
0
Honestly, you don't even reply to your answers. I posted an answer to one of yours before and still have no reply. superhudhayfa 39 — 6y

Answer this question