So I have a function in input began and I send tick with a bindable event and it doesnt want to work
CODE :
u.InputBegan:Connect(function(i,t)
if t then return end
if i.KeyCode == Enum.KeyCode.Q and isAir then
local Hold = tick()
Trigger:Fire(Hold)
Cast(m.Hit, m.Target, "LeftWebAttachment")
end
end)
In the function Cast
Trigger.Event:Connect(function(Hold)
if tick() - Hold <= .5 then
print("THUNK THAT")
else
if math.floor(humrp.Position.y) < math.ceil(pinpoint.WorldPosition.y) + 50 then
print("Playing Animation")
hum:LoadAnimation(game.ReplicatedStorage.Swing1):Play()
end
SpawnBeam(pinpoint.WorldPosition,pinpoint, "leftweb")
AddForce(pinpoint.WorldPosition,pinpoint,game.Workspace:WaitForChild("leftweb"))
end
end)
t here is gameprocessed and It returns true but you detect if its true and return just do
u.InputBegan:Connect(function(i,t)
if not t then return end
if i.KeyCode == Enum.KeyCode.Q and isAir then
local Hold = tick()
Trigger:Fire(Hold)
Cast(m.Hit, m.Target, "LeftWebAttachment")
end
end)
GameProcessed is true, whenever the game has processed the input.
It’ll be true, say when the player is typing in a TextBox.
So when you are doing not t, when the game hasn’t processed the input, it’ll return true.
This means that the check will pass, and now return, making the script end there.
Edit: last explanation why it wouldn’t work is a bit incorrect, so I edited it to be a bit more thorough and clear.