So basically whenever my character resets the function below stops working, I’ve tried refreshing the character variable each time the character respawns however it still isn’t working.
CharacterAdded refresh:
LP.CharacterAdded:Connect(function(char2)
character = char2
humanoid = character:WaitForChild("Humanoid")
print(character)
end)
Function:
character:WaitForChild("Values").KeyDown:GetPropertyChangedSignal("Value"):Connect(function()
print("1")
if character:WaitForChild("Values").KeyDown.Value == true then
while character:WaitForChild("Values").KeyDown.Value == true do
print("2")
local mousepos = mouse.Hit.Position
RS.va:FireServer("MouseUpdate", mousepos)
wait(0.1)
end
end
end)
Any help is appreciated.