![]() So basically the CashGiver scripts are basic scripts giving player Cash every second. If MarketPlace:UserOwnsGamePassAsync(player.UserId, g) then Player:WaitForChild("leaderstats").Cash.Value += 10ĬashGiverHandler : local MarketPlace = game:GetService("MarketplaceService") Player:WaitForChild("leaderstats").Cash.Value += 5 Here are the scripts I added to each script.įor i, player in pairs(game.Players:GetPlayers()) do Here is how I did it I made 3 scripts in ServerScriptService with the name of CashGiver5, CashGiver10, and CashGiverHandler ![]() So I figured out a way to solve this issue and I have got the answer for my question. Game.ReplicatedStorage:WaitForChild("Give5Cash"):FireServer() Game.ReplicatedStorage:WaitForChild("Give10Cash"):FireServer() If MPS:UserOwnsGamePassAsync(player.UserId, id) then Local MPS = game:GetService("MarketplaceService") Give10Cash.OnServerEvent:Connect(function() Give5Cash.OnServerEvent:Connect(function() Local Give10Cash = game.ReplicatedStorage:WaitForChild("Give10Cash") I Haven't any scripts to give cash but the problem is in the 2nd script block, the console print an error :Ġ9:10:57.466 ServerScriptService.CashGiver:6: attempt to index nil with 'UserId' - Server - CashGiver:6 local Give5Cash = game.ReplicatedStorage:WaitForChild("Give5Cash") So I was making a script that gives you 5 cash every minute, I also made a game pass for the script if someone owns the game pass they get double money as the Non-game pass holders. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |