I want to disconnect the JumpConnection in the server but the connection its created in the client (im using a remote event) , I’ve tried to fire the JumpConnection variable to the server but it doesnt work
This is the local script i dont think its gonna help but whatever
local UserInputService = game:GetService("UserInputService")
local Debris = game:GetService("Debris")
local Debounce = true
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent
local Character = script.Parent
local RootPart = Character.HumanoidRootPart
Character.HumanoidRootPart.Touched:Connect(function(HitPart)
if Character.Humanoid.FloorMaterial == Enum.Material.Air and Debounce then
Debounce = false
local JumpConnection
JumpConnection = UserInputService.JumpRequest:Connect(function() -- Fires when the player tries to jump
RemoteEvent:FireServer(Character, RootPart, JumpConnection)
end)
end
wait(.3)
Debounce = true
end)