So I’ve been planning on making a gamepass for my game for a while now, and I’ve finally decided that I wanted to start working on it.
I’m a pretty new scripter so I don’t know a whole lot about how to make a gamepass, and I’ve watched many tutorials but can never find one for what I’m trying to add.
I’m trying to Enable a script that contains the main function for the gamepass but I’m clueless on if I’m doing something wrong, or if you can’t Enable/Disable a script… from another script.
Here’s the code:
local Players = game:GetService("Players")
local id = 254553044
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:connect(function(char)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
print("")
game.StarterPlayer.StarterPlayerScripts.NightVisionGP.Disabled = false
end
end)
end)
Help, is much appreciated.