I am bad at scripting and I found this script and edited it, but of course it was wrong. I want to make it where it enables or disables a script, FOR THE LOCAL PLAYER! I have the script below, please fix it!
Inside of {ServerScriptService} there are MainTokens and TokensDouble scripts. TokensDouble script is disabled and MainTokens is enabled!
I know it is game.Players.LocalPlayer.Something, but I don't know what. PLEASE HELP ME!
local passId = 910298336 -- change this to your game pass ID. function isAuthenticated(player) -- checks to see if the player owns your pass return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end game.Players.PlayerAdded:connect(function(plr) if isAuthenticated(plr) then game.Players.LocalPlayer.PlayerScripts.MainTokens.Disabled = true game.Players.LocalPlayer.PlayerScripts.TokensDouble.Disabled = false else game.Players.LocalPlayer.PlayerScripts.MainTokens.Disabled = false game.Players.LocalPlayer.PlayerScripts.TokensDouble.Disabled = true end end)
I didn't fully understand what you're intended to do, but hopefully this one will work, I am a noob myself.
local id = 910298336 local player = game.Player.LocalPlayer if game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then game.Players.LocalPlayer.PlayerScripts.MainTokens.Disabled = false -- if player have the Pass, the script is enabled. else game.Players.LocalPlayer.PlayerScripts.MainTokens.Disabled = true -- if player don't have the Pass, the script is disabled. end