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 4 years ago
Edited 4 years ago

this is what its used to undisable it

local function disable()
    if not game.Workspace.Interactables.Cube.Anchored then
        script.Parent.Tutorial6.Disabled = true
    end
end

repeat disable(); wait()
until script.Parent.Tutorial6.Disabled == false

and this is the script thats being undisabled

local text = "To start, Left Click the cube."
    game.Workspace.Map.TutorialRestriction.Invis1.CanCollide = false
    script.Parent.Tutorial.Click.Playing = true
for i = 1, #text do
    script.Parent.Tutorial.Gui.TextLabel.Text = string.sub(text, 1, i)
  wait(0.0625)
end
if text ==  "To start, Left Click the cube." then
    script.Parent.Tutorial.Click.Playing = false
    repeat
    if game.Workspace.Interactables.Cube.Anchored == false then
        script.Parent.Tutorial6.Disabled = true
    end
    until script.Parent.Tutorial6.Disabled == false
end

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 — 4y
0
im trying to make a tutorial and only move to the next part when the previous part has been comleted RazerGaming2312 3 — 4y

1 answer

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

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

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

And then for the enabling:

local localscript = game.ServerStorage.LocalScript
localscript.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 — 4y
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 — 4y
Ad

Answer this question