Attempt to index a nil Value?
Asked by
4 years ago Edited 4 years ago
whenever i test this gamepass is tells me attempt to index nil with a value.like this worked for other things why doesent it work on this.
02 | local stats = game.ServerScriptService:WaitForChild( "LeaderStats" ):FindFirstChild( "leaderstats" ) |
03 | local Pmoney = game.ServerScriptService:WaitForChild( "LeaderStats" ):FindFirstChild( "Cash" ) |
04 | local Pmulti = game.ServerScriptService:WaitForChild( "LeaderStats" ):FindFirstChild( "Multi" ) |
05 | local Preb = game.ServerScriptService:WaitForChild( "LeaderStats" ):FindFirstChild( "Rebirths" ) |
06 | game:GetService( "MarketplaceService" ).PromptGamePassPurchaseFinished:Connect( function (plr,ido,purchased) |
07 | if purchased and id = = ido then |
08 | Pmulti.Value = Pmulti.Value + 1000000 |
sorry if this is very messy i tried to make it simple but it didn't work or maybe it did.