Hello. I’m trying to make an ability that teleports you a certain amount of distance based on how long you hold it. Think of it as a channeling teleport. I would like the player to be stationary when channeling this ability. The catch is I want to make the player stationary by firing remote events. (If you’re wondering why I don’t want to just change the walk speed and jump power, it’s because I need this to be compatible with a “player status” value I made, and that doesn’t detect the “player status” by jump power or walk speed). Basically, I’m wondering just how efficient this is and how much lag it will cause.
local function holdingDown()
return userInputService:IsKeyDown(N)
end
abilities.ChannelingTeleport.OnServerEvent:Connect(function(player)
local heldTime = 0
while holdingDown() do
wait(0.01)
heldTime = heldTime + 0.01
RP.RemoteEvents.ChangeStatus:FireClient(player, "Root", 0.01)
end
end)