How to fix LocalScript not working even when disabled is set to false?
I have two scripts named "ColorChange" and "Script", "Script" is only executed when "ColorChange" is executed, this is what contains inside "ColorChange":
01 | local pad = script.Parent |
04 | local user = game.Players:GetPlayerFromCharacter(hit.Parent) |
06 | pad.BrickColor = user.TeamColor |
11 | script.Parent.Touched:connect(onTouch) |
This is what then contains inside "Script":
1 | local function trigger() |
2 | game.StarterGui.ScreenGui.TextButton.LocalScript.Disabled = false |
6 | game.Workspace.A.Changed:Connect(trigger) |
"Script" is supposed to enable the LocalScript inside the TextButton once "ColorChange" changes the BrickColor of the part, the TextButton is a teleportation Button of which when a player presses the TextButton, they are teleported to the designated part (The part's name is A)
But there's one issue I am facing, even when the LocalScript is successfully enabled, the player won't teleport to the designated part when the button is pressed, how do I fix this?
Here's a video about the issue I am currently facing:
https://gyazo.com/ecb4f1154705a87ba7f8754c1892eb92