Programming a gui button to act as a Shift Button

I want to use something other than contextactionservice to run my sprint script on mobile, I want a gui button to act like a shift button when pressed and also when released, how will I go around this?

In a localscript you could capture updates to the textbox then upper case them.

string.upper(STRING)

No, I mean like make a guibuton act as a LeftShift button, so I can implement this to mobile users

Just do


script.Parent.MouseButton1Click:Connect(function()
-- insert humanoid walkspeed script here
-- make sure to put this inside the textbutton as the script.Parent is the text button
end)

No, I already have a Sprint script, I don’t want to overcomplicate things, I just want to like REBIND the gui button to function as LeftShift like in a keyboard.

Basically A LeftShift Button for mobile users

I don’t understand what you mean, you want a TextButton that is a LeftShift for mobile? what?

yes when a mobile player clicks it, it will execute as a LefShift keyboard which will trigger my Sprint Script

The MouseClick doesn’t restrict the mobile users from pressing it so enter the sprint script into the script I showed earlier and It will work.

EDIT: the mouseClick is just telling you that something will happen after it is clicked.

argh, but I already have a complex made sprint script, I dont want to make another one.

Mine has an update function and a Stamina bar which depletes and updates, I’ll have to manually redo my script if that’s the case

I am not talking about the sprint script, I am talking about the mobile users pressing the GUI. I just said that the mouseButtonClick doesn’t restrict users so just insert your sprint below.

1 Like