Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i need help with mobile support?

Asked by 1 year ago
Edited 1 year ago

So i have this script that makes your walkspeed faster depending on how much your moving your mouse But i have a problem How do i make it work for mobile? or xbox Cuz i want my game to support all devices

local health = 18.3

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local char = player.CharacterAdded:Wait()
local mouse = player:GetMouse()
local Cam = game.Workspace.CurrentCamera
mouse.Move:Connect(function()
    char.Humanoid.WalkSpeed += 0.72
    wait(1)
    if char.Humanoid.WalkSpeed <= health then
        char.Humanoid.WalkSpeed = health
        else
        char.Humanoid.WalkSpeed -= 0.72
        end
end)

player.CharacterAdded:Connect(function(character)
    char = character
end)

Answer this question