So im tyring to make a skill system but im not sure how im going to do it for mobile. On mobile they have to click a gui like dungeon quest but idk how im going to do it, can someone help me?
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local st = game:GetService("StarterGui")
local detroit = rp.Events:WaitForChild("Skill1")
local cam = rp.Events:WaitForChild("Camm")
local UIS = game:GetService("UserInputService")
local debounce = false
local player = game:GetService("Players").LocalPlayer
local value = player:WaitForChild("Cooldown")
local gui = game.StarterGui.MainGui.HUD.SkillsHolder.Slot1.CooldownE
local cooldown = script.Parent.Values.Cooldown.Value
function cameraShake()
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
for i=1, 30 do
local a = math.random(-10,10)/100
local b = math.random(-10,10)/100
local c = math.random(-10,10)/100
Humanoid.CameraOffset = Vector3.new(a,b,c)
wait()
end
Humanoid.CameraOffset = Vector3.new(0,0,0)
end
UIS.InputBegan:Connect(function(input,isTyping)
if script.Parent.Values.Equipped.Value == true then
if isTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 or input.KeyCode == Enum.KeyCode.E then
if debounce == false then
debounce = true
detroit:FireServer()
end
end
end
end)
detroit.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
end)
cam.OnClientEvent:Connect(function()
cameraShake()
end)
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local st = game:GetService("StarterGui")
local detroit = rp.Events:WaitForChild("Skill1")
local cam = rp.Events:WaitForChild("Camm")
local UIS = game:GetService("UserInputService")
local debounce = false
local player = game:GetService("Players").LocalPlayer
local value = player:WaitForChild("Cooldown")
local gui = game.StarterGui.MainGui.HUD.SkillsHolder.Slot1.CooldownE
local cooldown = script.Parent.Values.Cooldown.Value
function cameraShake()
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
for i=1, 30 do
local a = math.random(-10,10)/100
local b = math.random(-10,10)/100
local c = math.random(-10,10)/100
Humanoid.CameraOffset = Vector3.new(a,b,c)
wait()
end
Humanoid.CameraOffset = Vector3.new(0,0,0)
end
UIS.InputBegan:Connect(function(input,isTyping)
if script.Parent.Values.Equipped.Value == true then
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.E then
if debounce == false then
debounce = true
detroit:FireServer()
end
end
end
end)
detroit.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
end)
cam.OnClientEvent:Connect(function()
cameraShake()
end)
script.Parent.Parent.Parent.Parent.Parent.HUD.SkillsHolder.Slot1.TouchTap:Connect(function()
detroit:FireServer()
end)
script.Parent.Parent.Parent.Parent.Parent.HUD.SkillsHolder.Slot1.TouchTap:Connect(function()
if not debounce and script.Parent.Values.Equipped.Value then
debounce = true
detroit:FireServer()
end
end)
It’s basically the same thing you did with UIS.InputBegan, it just doesn’t check for a keycode