#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)

fallow gale
#

screen or WASD on pc it makes it do the sprint thing

#

Please help I might even pay at this rate from how annoying this is ;-;

mellow summit
#

uh

#

Activated is an event

fallow gale
mellow summit
#

sec

fallow gale
#

wait so what does that mean in like

mellow summit
# fallow gale screen or WASD on pc it makes it do the sprint thing

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)
mellow summit
silent spireBOT
#

studio** You are now Level 18! **studio

fallow gale
#

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

mellow summit
#

uhhh

#

buttons have .InputBegan and .InputEnded too

#

so what you could do

mellow summit
#

im not sure

#

sec

#

yeah