How do I make it so one script CANNOT function until the transparency is set to 0 by another script?
Asked by
5 years ago Edited 5 years ago
Goal: I would like one script (script A) to allow another script to work (script B) based on transparency.
Problem #1: Is it possible to store my tools in ServerStorage rather than Lighting?
Problem #2: How can I make it so one script CANNOT function until the transparency of it is equal to 0?
Problem #3: Are the booleans false
and nil
completely alike?
Other Information:
WORKSPACE: Project (folder) -> Functions (folder) -> HammerGiver, HammerOutput, WrenchGiver, WrenchOutput, Planks (grouped model)
LIGHTING: Tools (folder) -> Hammer, Wrench
HAMMER GIVER/INPUT SCRIPT
1 | function OnClick(PersonWhoClicked) |
2 | local y = PersonWhoClicked.Backpack |
3 | local z = game.Lighting.Tools [ "Hammer" ] |
5 | game.Workspace.Project.Functions.HammerGiver:Destroy() |
8 | script.Parent.ClickDetector.MouseClick:connect(OnClick) |
HAMMER OUTPUT SCRIPT
1 | script.Parent.Touched:connect( function (p) |
2 | if p.Parent.Name = = "Hammer" then |
3 | game.Workspace.Project.Functions.HammerOutput.MeshPart.Transparency = 0 |
5 | game.Workspace.Project.Functions.Planks.Plank 1. Anchored = false |
6 | game.Workspace.Project.Functions.Planks.Plank 2. Anchored = false |
7 | game.Workspace.Project.Functions.WrenchGiver.MeshPart.Transparency = 0 |
WRENCH GIVER/INPUT SCRIPT
PROBLEM!!!
1 | function OnClick(PersonWhoClicked) |
2 | local y = PersonWhoClicked.Backpack |
3 | local z = game.Lighting.Tools [ "Wrench" ] |
5 | game.Workspace.Project.Functions.WrenchGiver:Destroy() |
8 | script.Parent.ClickDetector.MouseClick:connect(OnClick) |
Notes:
-hammer transparency is 0
-wrench transparency is 1
POSSIBLE SOLUTIONS
1) How do I make it so the WrenchGiver does not work until the MeshPart transparency is 0?
2) How do I remove the ClickDetector from the WrenchGiver until the MeshPart transparency is 0?