Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gamepass script to modify other script not working?

Asked by
zomspi 541 Moderation Voter
5 years ago

I made a gamepass script so when a player has bought the gamepass, a script runs which disables a script and enables another, I would like it to just change a number in the other script but I didn't know how to do that so I resorted to this although it doesn't seem to be working. I don't know if it will work if I put a number value in the other script (cash on kill) and just modify that number when the gamepass is bought? Here is my script: ~~~~~~~~~~~~~~~~~ local gamepass = script:WaitForChild("GamePassid") local service = game:GetService("GamePassService")

    game.Players.PlayerAdded:connect(function(player)end)
     if service:PlayerHasPass(player,gamepass.Value)then if
       game.Workspace.CashOnKill1.Disabled ~= false then 
        game.Workspace.CashOnKill1.Disabled = true if
        game.Workspace.CashOnKill1.Disabled ~= true then
            game.Workspace.CashOnKill2.Disabled = false
       end
      end
    end

~~~~~~~~~~~~~~~~~ Thanks!

0
i dont get what your asking EmbeddedHorror 299 — 5y
0
Put the numbervalue inside your script and in the scriot where you wan't to change your number, use a .Changed event for the numbervalue event and check if it's that number to which you've changed. AswormeDorijan111 531 — 5y

Answer this question