I have a game, where if the person is VIP and wins a round, it will give them their points, which is more than regular players. Though I am having an error come out in the output. 'Unable to cast to Object' on line 8. I'm not sure what this means or how to fix it. Any help is appreciated, thanks.
Edit: I have now solved this, I did this by changing line 8 to
if game:GetService("GamePassService"):PlayerHasPass(game.Players[v], gamepassId) then
Code:
local gamepassId = 1109268370 local gemsOnWin = 10 local vipWin = gemsOnWin * 1.5 for i,v in pairs(_G.playersInGame) do if v ~= nil then status.Value = v..' is the winner!' if game:GetService("GamePassService"):PlayerHasPass(v, gamepassId) then game.Players[v].leaderstats.Gems.Value = game.Players[v].leaderstats.Gems.Value + vipWin game.Players[v]: else game.Players[v].leaderstats.Gems.Value = game.Players[v].leaderstats.Gems.Value + gemsOnWin game.Players[v]:LoadCharacter() break end end end
2 too many ends