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

eaderstats script works in Studio, but not Roblox game, why? (is this specific enough)

Asked by 6 years ago

This script is supposed to take the value of Views, divide it by 35, and have the quotient be the value of Subscribers. It works in Studio but not in my game. I have tried many things: using WaitForChild, not using anything, putting a wait period of 5 minutes at the beginning of the script (what you see here) lots of different things. This is the script:

wait(300)
dividedby = 35
while true do
    wait(1)
    for _,player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats")then
    player.leaderstats.Subscribers.Value = ( player.leaderstats.Views.Value / dividedby )
end
end
end

0
I meant leaderstats lol sesamert16 31 — 6y
0
Can we see the leaderstats part of the script when it's being made?.. GetGlobals 343 — 6y

1 answer

Log in to vote
0
Answered by
GingeyLol 338 Moderation Voter
6 years ago

use player:WaitForChild("leaderstats")~=nil then

Ad

Answer this question