How do i make 'F' do something and fixinfinite yield?
Asked by
4 years ago Edited 4 years ago
~~~~~~~~~~~~~~~~~
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local Barrage = rp:WaitForChild("BarragePress")
local UIS = game:GetService("UserInputService")
local debounce = false
local cooldown = 3
UIS.InputBegan:Connect(function(input,IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.F then
1 | if workspace:FindFirstChild(Player.Name.. " Stand" ) then |
2 | if debounce = = false then |
end)
Barrage.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
end)
local Player = game:GetService("Players").LocalPlayer
local rp = game:GetService("ReplicatedStorage")
local Barrage = rp:WaitForChild("BarrageHold")
local UIS = game:GetService("UserInputService")
local debounce = false
local active = false
local cooldown = 3
UIS.InputBegan:Connect(function(input,IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.F then
1 | if workspace:FindFirstChild(Player.Name.. " Stand" ) then |
2 | if debounce = = false and active = = false then |
5 | Barrage:FireServer(active) |
end)
UIS.InputEnded:Connect(function(input,IsTyping)
if IsTyping then
return
elseif input.KeyCode == Enum.KeyCode.F then
1 | if workspace:FindFirstChild(Player.Name.. " Stand" ) then |
2 | if debounce = = true and active = = false then |
5 | Barrage:FireServer(active) |
end)
Barrage.OnClientEvent:Connect(function()
wait(cooldown)
active = false
debounce = false
end) ~~~~~~~~~~~~~
whenever i press F i get a error message is there something i did wrong?
ERROR:Infinite yield possible on 'ReplicatedStorage:WaitForChild("BarragePress")'