I am making a basic script were if you press a TextButton, your player will be able to move again. It's a local script and everything in the event isn't working the rest works fine. I get no error in the output and the print isn't printing.
local module = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")) local controls = module:GetControls() local button = game.StarterGui.FirstScreen.PlayButton controls:Disable() button.Activated:Connect(function() controls:Enable() button.Parent.Enabled = false print("button pressed") end)
I have tried changing the Activated event to MouseButton1Click but the result are the same.
Each time a player joins the game the StarterGui
's contents are cloned into that player's PlayerGui
. The PlayerGui
is the GUI that is displayed to the player
, therefore it should be like this
local button = game:GetService("Players").LocalPlayer.PlayerGui.FirstScreen.PlayButton
You can read more about PlayerGui here
Don't forget to mark my answer as the solution if it solved your problem(Upvotes are also really appreciated) :)