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

I need help with this?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I really couldn't put a more accurate title because it's more than one question. You see I made a script that every time a player joins my game, the script will check their money. If the money amount is inferior to 1, a Bindable-Function will disable the Local-Script.


local Disabler = game.ServerStorage.Disabler Disabler.OnInvoke = function() print("Temporarily disabling script....") game.StarterPack.LocalScript.Disabled = true end

Now, if the money amount is superior to 1, another Bindable-Function will un-disable it.

local UnDisabler = game.ServerStorage.UnDisabler
UnDisabler.OnInvoke = function()
    print("UnDisabling Devil Fruit Special tool")
    game.StarterPack.LocalScript.Disabled = false
end

What I want is for the Local-Script to not work until that person reaches the money amount required.

1 answer

Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
9 years ago

Don't use Disabled to "enable" or "disable" scripts. Really, Disabled should almost not exist.

Instead, use an if to check some other BoolValue or similar object.


Or, better yet, if you're comparing money, why not just check it in the LocalScript, rather than in the server's Script?


The StarterPack doesn't belong to any one person. It is what given to each person each time they spawn -- where it copies the object.

Changes to the StarterPack / StarterGui don't affect players that are currently alive.

Ad

Answer this question