Through some tutorials I was able to make a simple Fire Ball script; a bit sloppy but it works. When I added another input to fire a different fireball, or another skill, it seems you are able to press both keys and fire both remotes at the same time. I was thinking of a Boolean, but I wouldn’t know where to start. Maybe a way to wait at least a second before inputting another key would be helpful.
if example needed
(Use The tool to get the skills , then press E & R simultaneously.)
Prevent Double Key Input.rbxl (93.3 KB)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Plr = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Remote = ReplicatedStorage.Events.FireBallEvent
local Remote2 = ReplicatedStorage.Events.FireBallEvent2
local Mouse = Plr:GetMouse()
local Debounce = true
local Animation = Instance.new("Animation")
Animation.AnimationId = 'rbxassetid://4805325052'
UIS.InputBegan:Connect(function(Inp, IsTyping)
if IsTyping then return end
if Inp.KeyCode == Enum.KeyCode.R and Debounce and Char then
Remote2:FireServer(Mouse.Hit)
Debounce = false
script.RemoteEvent1:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
wait(10)
Debounce = true
end
end)
UIS.InputBegan:Connect(function(Inp, IsTyping)
if IsTyping then return end
if Inp.KeyCode == Enum.KeyCode.E and Debounce and Char then
Remote:FireServer(Mouse.Hit)
Debounce = false
script.RemoteEvent2:FireServer()
local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
LoadAnimation:Play()
wait(6)
Debounce = true
end
end)