I was trying to make a script that changed text of a GUI to something else after pressing "Z" button, but i could only make it do first function. How can i make it do second function after first function?
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "z" then
One()
end
end)
function One()
script.Parent.Text = "..."
end
function Two()
script.Parent.Text = "Test1"
end
function Three()
script.Parent.Text = "Test2"
end

6 comments
Thank you for the help!
UserInput this way is deprecated, you should convert to UserInputService.
The script doesnt seem to work in game (but it works in studio). Also the problem is that i'm a beginner in scripting.
use Enums @Alexeeii
I tried using them, they work in studio but not in game.
I found a way to fix it, just make the script local.