Not sure if you know this but moving the root part of a character by changing its position breaks the welds and kills the player. You have to use cframes @Faczki.
EDIT: You could also make a custom idle animation and have that stutter back and forth. It would be easier.
No, Position and CFrame are different properties for a reason. Changing the root part’s Position property will kill the player. Changing the CFrame will not. Hence the function, :SetPrimaryPartCFrame()
Well, you could do something like this to make them vibrate:
local player = game.Players.LocalPlayer
local char = player.Character
local hrp = player.Character:WaitForChild("HumanoidRootPart")
local isVibrating = false
someEvent:Connect(function()
isVibrating = not isVibrating -- Toggles it
end)
while isVibrating do
-- do something with the 'hrp' variable to make them shake.
wait(.1)
end
I made this simple function which will run code constantly for the imputed time:
function RunForSeconds(seconds)
local startTick = tick()
while tick() <= startTick + seconds do
-- CODE TO RUN FOR CERTAIN TIME
wait(0.01) -- Cool down to prevent crash
end
end