i am try to make make it so when a player is touching a certain object, the player jumps backwards but the script I made is only making the player jump.
damagePlane = script.Parent
function damage(hit)
local partParent = hit.Parent
local humanoid = partParent:FindFirstChild("Humanoid")
local player = game:GetService("Players"):GetPlayerFromCharacter(partParent)
local character = player.Character
local rootPart = player.Character:FindFirstChild("HumanoidRootPart")
local direction = rootPart.CFrame + rootPart.CFrame.LookVector
if player then
humanoid.Jump = true
player:Move(-direction, false)
end
end
damagePlane.Touched:Connect(damage)

2 comments
It’s humanoid move, not player move
when I changed that i got this error message Workspace.(model that the damage plane is in).damagePlane.damage:12: attempt to perform arithmetic (unm) on CFrame