#For the mobile Button with "GUI.SprintButton.Activated" it makes it so when i press anywhere on the
1 messages · Page 1 of 1 (latest)
aight
sec
wait so what does that mean in like
so here you're checking if input.keycode == leftshift AND userinputtype ~= gamepad OR button.Activated idk rlly how to explain but you have or here and button.Activated returns "Signal Activated" cuz its an Event not boolean soooooo its always true and thats why it activates sprint
srry for my english i tried my best lel
local uis = game:GetService("UserInputService")
local function onInput(key)
if (key.UserInputType ~= Enum.UserInputType.Gamepad1 and key.UserInputType ~= Enum.UserInputType.Touch) and key.KeyCode == Enum.KeyCode.LeftShift then
print("its PC")
end
end
local function onInputM(key)
if key.UserInputType == Enum.UserInputType.Touch then
print(key.UserInputState == key.UserInputState.Begin)
--Sprint(key.UserInputState == key.UserInputState.Begin)
end
end
uis.InputBegan:Connect(onInput)
uis.InputEnded:Connect(onInput)
GUI.SprintButton.InputBegan:Connect(onInputM)
GUI.SprintButton.InputEnded:Connect(onInputM)
here onInput checks if gamepad and touch is disabled and if keycode is leftshift, it will print "its PC" and below is .Activated event for gui button (for mobile)
** You are now Level 18! **
Yo appreciate the help man, is it alright if you could help me with what i need to put into GUI.SprintButton.Activated? I'm currently tryna figure out that part put I'm pretty stuck on it
local function OnInput(input)
if input.KeyCode == Enum.KeyCode.LeftShift and input.UserInputType ~= Enum.UserInputType.Gamepad1 then
SprintHeld = input.UserInputState == Enum.UserInputState.Begin
Sprint(SprintHeld)
end
end
GUI.Parent.MobileButton.SprintButton.Activated:Connect(function()
SprintHeld = true
Sprint(true)
end)
this Part im really stuck on since it makes it increase the speed each time i press it, not too sure how i can have it so when i release it returns back to the normal speed and the sprint bar then goes up
smth like this
im not sure
sec
yeah