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)

2 comments
that didn't work
what do you mean by: "game.player.localplayer.playerscripts.maintokens"? where is that?