I have two scripts named "ColorChange" and "Script", "Script" is only executed when "ColorChange" is executed, this is what contains inside "ColorChange":
local pad = script.Parent
function onTouch(hit)
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
if user ~= nil then
pad.BrickColor = user.TeamColor
end
end
script.Parent.Touched:connect(onTouch)
This is what then contains inside "Script":
local function trigger()
game.StarterGui.ScreenGui.TextButton.LocalScript.Disabled = false
end
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

3 comments
You are attempting to disable the script from ScreenGui, which is the replicator of UIs, and not the UI itself. In order to disable the script correctly you have to access the UI via PlayerGui, which is found inside the player and can be fetched using Player.PlayerGui.
Sorry but I've just started scripting a week ago and this looks a little advanced for me, I tried to study what PlayerGui is and how to access it but I still cannot comprehend what I am reading, would it involve RemoteEvents in order for what you're saying to work?
RemoteEvents are used for the client to communicate with the server or the opposite