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

What's wrong with this?

Asked by 10 years ago

Why am I not getting the 10K cash per second?

function onPlayerEntered(newPlayer)
    if newPlayer.className == "Player" then

        local stats = Instance.new("IntValue")
        stats.Name = "leaderstats"

        local cash = Instance.new("IntValue")
        cash.Name = "Cash"
        cash.Value =1000

        cash.Parent = stats
        stats.Parent = newPlayer

        local gems = Instance.new("IntValue")
        gems.Name = "Gems"
        gems.Value =0

        gems.Parent = stats
        stats.Parent = newPlayer

        local diamonds = Instance.new("IntValue")
        diamonds.Name = "Diamonds"
        diamonds.Value =0

        diamonds.Parent = stats
        stats.Parent = newPlayer    

        local Admins = Instance.new("IntValue")
        Admins.Name = "Admins"
        Admins.Value = 0

        Admins.Parent = stats
        stats.Parent = newPlayer

id = 103728213
access = {"fahmisack123","A380Guy","Player1"}
if newPlayer.Name == #access or Game:GetService("GamePassService"):PlayerHasPass(newPlayer, id)then
    while true do
        newPlayer.leaderstats.Cash.Value = newPlayer.leaderstats.Cash.Value + 10000
        wait(1)
    end
end 

        if game.Players:findFirstChild("IsHere"..newPlayer.Name)== nil then
            local newPerson = Instance.new("IntValue")
            newPerson.Name = "IsHere"..newPlayer.Name
            newPerson.Parent = game.Players
        end
    end
end

Output says that Game Pass Services must be used in a normal script, this is in a normal script...

0
I can see one error, on line 44 it's FindFirstChild, not findFirstChild FearMeIAmLag 1161 — 10y
0
Any other error? because that worked even if it was findFirstChild fahmisack123 385 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

Your problem is you must have a actual running server :) The game pass must also be apart of the game.

0
even with an actual running server it didn't work. fahmisack123 385 — 10y
0
Hmm... try the roblox wiki it should have your answer :) joshuatodd21 40 — 10y
Ad

Answer this question