So I'm making a clicking simulator, with gamepasses that increase the click increment value. I have an IntValue which tells the game what the Click Increment is.
My script,
local IncVal = script.Parent.IncrementValue.Value
local Gamepass2xClicksID = 12345 -- TempValue
local Gamepass5xClicksID = 123456 -- TempValue
local Gamepass10xClicksID = 1234567 -- TempValue
local Player = game.Players.LocalPlayer
local IncVal = 1
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player, Gamepass2xClicksID) then
IncVal = 2
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player, Gamepass5xClicksID) then
IncVal = 5
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(Player, Gamepass10xClicksID) then
IncVal = 10
script.Parent.MouseButton1Click:Connect(function()
Player.leaderstats.Clicks.Value = game.Players.LocalPlayer.leaderstats.Clicks.Value + IncVal
end)
end
is correct, no errors. However, when I play the game, I get the Output error of:
Unable to cast Instance to int64
How can I fix this?

1 comment
Thanks, let me try this out and I'll update you on it.