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

why doesnt a local script activate when its been undisabled by another script?

Asked by 5 years ago
Edited 5 years ago

this is what its used to undisable it

1local function disable()
2    if not game.Workspace.Interactables.Cube.Anchored then
3        script.Parent.Tutorial6.Disabled = true
4    end
5end
6 
7repeat disable(); wait()
8until script.Parent.Tutorial6.Disabled == false

and this is the script thats being undisabled

01local text = "To start, Left Click the cube."
02    game.Workspace.Map.TutorialRestriction.Invis1.CanCollide = false
03    script.Parent.Tutorial.Click.Playing = true
04for i = 1, #text do
05    script.Parent.Tutorial.Gui.TextLabel.Text = string.sub(text, 1, i)
06  wait(0.0625)
07end
08if text ==  "To start, Left Click the cube." then
09    script.Parent.Tutorial.Click.Playing = false
10    repeat
11    if game.Workspace.Interactables.Cube.Anchored == false then
12        script.Parent.Tutorial6.Disabled = true
13    end
14    until script.Parent.Tutorial6.Disabled == false
15end
0
I don't really get what you're asking, the first script is constantly disabling it and then checking if it isn't disabled. cmgtotalyawesome 1418 — 5y
0
im trying to make a tutorial and only move to the next part when the previous part has been comleted RazerGaming2312 3 — 5y

1 answer

Log in to vote
1
Answered by
Slatryte 104
5 years ago
Edited 5 years ago

I really suggest simplifying it by putting the ServerStorage to use. Like this:

1--Script Disabling
2local localscript = game.ServerScriptService.LocalScript --Or any other place you have placed it in.
3localscript.Parent = game.ServerStorage

And then for the enabling:

1local localscript = game.ServerStorage.LocalScript
2localscript.Parent = game.ServerScriptService --Again, or any place you placed it in.

Hope that help solves the problem! Next time you make an Enabling/Disabling script, unless it is for GUIs, put your ServerStorage to use. For GUIs, try to use the Enabled/Visible properties. Again, I hope it works.

0
sorry for not giving enough imfo but im trying to make a tutorial and only move to the next part when the previous part has been completed, and thats why im having it constantly check if the part is unanchored RazerGaming2312 3 — 5y
0
Oh! i've figured it out! it takes a whilebut i have to add a letter every time, it works, thanks to everyone who tried to help! RazerGaming2312 3 — 5y
Ad

Answer this question