#dodge input not working
1 messages · Page 1 of 1 (latest)
while true do
task.wait (0.1)
local playerposition = rootpart.Position
print (playerposition)
end
function dodgerollforward ()
UserInputService.InputBegan:Connect(function (input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.Q then
print ("Presed Q")
while UserInputService:IsKeyDown(Enum.KeyCode.W) do
task.wait (0.1)
print ("Holding w")
print("Dodging")
local newposition = playerposition.Vector3.yAxis * dodgeDistance
local Tween = TweenService:Create(playerposition, Enum.EasingStyle.Linear ,newposition)
print(newposition)
Tween:Play()
return isDodging == false
end
elseif isDodging == false or canDodge == false then
print("False")
end
end
end)
end
while true do
task.wait (1)
dodgerollforward()
end
in text if better
all local script in startplayerscripts
uhh because it is stuck in an loop
could you be more specific
like what is stuck in which loop
while true do
alr
so do i jst delete that
or like
how do i call the function
u already called it, no?
this loop ```lua
while true do
task.wait (0.1)
local playerposition = rootpart.Position
print (playerposition)
end
this is making your script not run because it is stuck here
ohh
you can use ```lua
task.spawn(function()
while true do
task.wait (0.1)
local playerposition = rootpart.Position
print (playerposition)
end
end)
task.spawn runs a function without blocking the rest
i dont like while true statements
sometimes they need to be used
but on this one
it didnt need to be used
wouldnt it make more sense to call for the position in the function you need it for
he could use getpropertychangedsignal
thst doesnt work for position and cframes
rlly?
didnt know that
what i could use instead
yea pretty sure
alignposition
or js while true loop likes here