Hi, I'm trying to make my game more mobile compatible. Can someone help with me binding a skill functions? Thanks.
local cas = game:GetService("ContextActionService")
local plr = game.Players.LocalPlayer
local char = plr.Character
repeat wait() until char.Humanoid
local hum = char.Humanoid
repeat wait() until plr.Skills
local skills = plr.Skills
local speed = skills.Speed
local invis = skills.Invisibility
local cooldown = false
function useskillmobile()
if cooldown == false then
if speed == true then
hum.WalkSpeed = 24
cooldown = true
wait(5)
cooldown = false
hum.WalkSpeed = 16
elseif invis == true then
char["Left Arm"].Transparency = 1
char["Right Arm"].Transparency = 1
char["Left Leg"].Transparency = 1
char["Right Leg"].Transparency = 1
char["Torso"].Transparency = 1
char["Head"].Transparency = 1
cooldown = true
wait(5)
char["Left Arm"].Transparency = 0
char["Right Arm"].Transparency = 0
char["Left Leg"].Transparency = 0
char["Right Leg"].Transparency = 0
char["Torso"].Transparency = 0
char["Head"].Transparency = 0
cooldown = false
end
end
end
cas:BindAction("Use Skill", useskillmobile, true, "x")

2 comments
Thank you. I actually really forget sometimes to put .Value at some of them. Thanks.
No problem.