Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's wrong with this?

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...

2 comments

0

I can see one error, on line 44 it's FindFirstChild, not findFirstChild

0

Any other error? because that worked even if it was findFirstChild

1 answer

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

2 comments

0

even with an actual running server it didn't work.

0

Hmm... try the roblox wiki it should have your answer :)

This discussion is preserved as it was. New answers, comments, and votes are closed.