This might be more related to the physics of Roblox. I'm making a feature where your character will teleport to a certain position. It checks to see if they are sitting, and if so, the 'Sit' property is set to false, and then the character is teleported. It teleports the character when they don't sit, but if they are sitting, it will only set the 'Sit' property to false, and not teleport them. Is there any way to get around this instead of a delay?
local character = v.Character local humanoid = character.Humanoid -- Check if humanoid is sitting, and if so, set the 'Sit' property to false if humanoid.Sit then humanoid.Sit = false end -- Teleport the character character:MoveTo(Vector3.new(0, 100, 0))
To teleport you simple change the Primary Part CFrame.
local character = v.Character local humanoid = character.Humanoid -- Check if humanoid is sitting, and if so, set the 'Sit' property to false if humanoid.Sit then humanoid.Sit = false end -- Teleport the character humanoid:MoveTo(Vector3.new(0, 100, 0))
To teleport
local character = v.Character local humanoid = character.Humanoid local hrp = character.PrimaryPart -- Check if humanoid is sitting, and if so, set the 'Sit' property to false if humanoid.Sit then humanoid.Sit = false end -- Teleport the character hrp.CFrame = CFrame.new(0,100,0)
Humanoid.Sit is a boolean a true or a false.
if humanoid.Sit then hrp.CFrame = CFrame.new(0,100,0) end
Hope this helps!