Cannot change stuff in players folder

This script is meant to check if a player is in a team then if they are put a script in the players player script. The problem is the Player.PlayerScripts bit please help i tried putting it in starter script then disable and enable when needed but still it doesn’t work please help.

		for i, Player in ipairs(game.Players:GetPlayers()) do
			local Name = Player.Name
			local Delivery = game.Teams.Delivery
			if Player.Team == Delivery then
				print("Player is in team Delivery")
				local Now = game.ServerScriptService.LosingMoneyDelivery:clone()
				Now.Disabled = false
				Now.Parent = Player.PlayerScripts
				wait(20)
				Now:remove()
				while true do
					wait(5)
					Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value-1
					wait(15)
				end
			end	
		end
	end

You should try enabling it after you reparent the script. Otherwise it will run and be initialized before it is able to reference the player.

Instead of this:

Now.Disabled = false
Now.Parent = Player.PlayerScripts

try this

Now.Parent = Player.PlayerScripts
Now.Disabled = false

This would only account for new players that would join the game, did you mean to place it inside the Player or Character object itself?

		for i, Player in ipairs(game.Players:GetPlayers()) do
			local Name = Player.Name
			local Delivery = game.Teams.Delivery
			if Player.Team == Delivery then
				print("Player is in team Delivery")
				local Now = game.ServerScriptService.LosingMoneyDelivery:clone()
				Now.Disabled = false
				Now.Parent = Player --PlayerScripts would only account for recent players that joined the game
				wait(20)
				Now:remove()
				while true do
					wait(5)
					Player.leaderstats.Cash.Value = Player.leaderstats.Cash.Value-1
					wait(15)
				end
			end	
		end
	end		

So basically this is part of a bigger script and when certain functions are correct etc then this function works. I have place the LosingMoneyDelivery script inside ServerScriptService and disabled it and I want it to check if each player for i, Player in ipairs is in the Team Delivery. Then if they are in the team it clones the script to their Playerscripts and enables the script to work. image