Line 5 issue
01 | local id 1 = 19453079 |
02 | local id 2 = 20607058 |
03 | plr = script.Parent.Parent.Parent |
04 | local aree = os.time |
05 | script.Parent.f.b.MouseButton 1 Click:connect( function () |
06 | g = game:GetService( "MarketplaceService" ) |
07 | g:PromptProductPurchase(plr, id 1 ) |
08 | end ) |
09 |
10 | script.Parent.f.ar.MouseButton 1 Click:connect( function () |
11 | DataStore = game:GetService( "DataStoreService" ):GetGlobalDataStore(shoplistaer) |
12 | local a = DataStore:GetAsync( "user_" ..plr.userId) |
13 | if a then |
14 | if a > = aree then |
15 | for i, v in pairs (game.Workspace:GetChildren()) do if v:IsA( "Sound" ) then v:Destroy() end end |
01 | local id 1 = 19453079 -- yep. mistake people always do... |
02 | local id 2 = 20607058 -- once again, the mistake happens! |
03 | -- well, let me fix this two. |
04 | plr = script.Parent.Parent.Parent |
05 | local aree = os.time |
06 | script.Parent.f.b.MouseButton 1 Click:connect( function () |
07 | g = game:GetService( "MarketplaceService" ) |
08 | g:PromptProductPurchase(plr, idone) |
09 | end ) |
10 |
11 | script.Parent.f.ar.MouseButton 1 Click:connect( function () |
12 | DataStore = game:GetService( "DataStoreService" ):GetGlobalDataStore(shoplistaer) |
13 | local a = DataStore:GetAsync( "user_" ..plr.userId) |
14 | if a then |
15 | if a > = aree then |
This is the fixed version i've made:
01 | local idone = 19453079 |
02 | local idtwo = 20607058 |
03 | plr = script.Parent.Parent.Parent |
04 | local aree = os.time() |
05 | function itWasClickedOMG() |
06 | g = game:GetService( "MarketplaceService" ) |
07 | g:PromptProductPurchase(plr, idone) |
08 | end |
09 |
10 | script.Parent.f.ar.MouseButton 1 Click:connect( function () |
11 | DataStore = game:GetService( "DataStoreService" ):GetGlobalDataStore(shoplistaer) |
12 | local a = DataStore:GetAsync( "user_" ..plr.userId) |
13 | if a then |
14 | if tonumber (a.keyvalue) > = tonumber (aree) then |
15 | for i, v in pairs (game.Workspace:GetChildren()) do if v:IsA( "Sound" ) then v:Destroy() end end |
Hope this helped! Thanks, marcoantoniosantos3
Output: Attempt to compare function with number :17
01 | local idone = 19453079 |
02 | local idtwo = 20607058 |
03 | plr = script.Parent.Parent.Parent |
04 | local aree = os.time |
05 |
06 |
07 | function one() |
08 | g = game:GetService( "MarketplaceService" ) |
09 | g:PromptProductPurchase(plr, idone) |
10 | end |
11 | script.Parent.f.b.MouseButton 1 Click:connect(one) |
12 |
13 | function two() |
14 | DataStore = game:GetService( "DataStoreService" ):GetGlobalDataStore(shoplistaer) |
15 | local a = DataStore:GetAsync( "user_" ..plr.userId) |
I don't know why the other two answers changed it, but there is absolutely nothing wrong with naming a variable id1
or id2
. As long as either an underscore ( '_' ) or english letter starts the variable name, numbers can be freely used.
You problem is that os.time
needs to be os.time()
, as you are trying to invoke the time
method, not access the function itself.