local textlabel = game.StarterGui.ScreenGui.TextLabel
game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(KeyPressed)
if KeyPressed == "g" then
if game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text == "Shii-Cho" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text = "Makashi"
else
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text = "Shii-Cho"
if game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text == "Makashi" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text = "Soresu"
end
end
end
end)
COMMUNITY QUESTION
My Keybind TextLabel Script Won't Work. Help please?
1 answer
Take a different approach. UserInputService is more appropriate.
label = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel
game:GetService("UserInputService").InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.G then
if label.Text == "Shii-Cho" then
label.Text = "Makashi"
elseif label.Text = "Makashi" then
label.Text = "Soresu"
else
label.Text = "Shii-Cho"
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
When I first pressed G, it only switches to Makashi, but when I press G again, it switches back to shii-cho, and not to soresu.