Hi, I want to make a lava that sends you up and deals 35 damage on touch. I tried changing velocity but its not the effect that I want to receive. Sometimes lava not sends you up(maybe because player is still mid air) and if you stand still, the touch is not being detected and you don’t take damage
Here’s a script I’m using
local damagePlayers = {}
script.Parent.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if not table.find(damagePlayers, hit.Parent) then
table.insert(damagePlayers, hit.Parent)
hit.Parent.Humanoid:TakeDamage(25)
wait()
hit.Parent.Humanoid.JumpPower = 100
hit.Parent.Humanoid.Jump = true
wait(0.1)
hit.Parent.Humanoid.JumpPower = 50
wait(0.3)
table.remove(damagePlayers, table.find(damagePlayers, hit.Parent))
end
end
end)
I think you can insert a BodyPosition into the player’s HumanoidRootPart that positions it upwards, then destroy it shortly.
--put this just after the wait() in the event
local bodyPos = Instance.new("BodyPosition")
bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyPos.D = 1250
bodyPos.P = 10000 --alter this property to change the force of the upwards boost
bodyPos.Position = hit.Parent.HumanoidRootPart.Position + Vector3.new(0, 10, 0)
bodyPos.Parent = hit.Parent.HumanoidRootPart
wait(.1)
bodyPos:Destroy()
bodyPos = nil
Thanks alot, but I have another problem now. I used Region3 for better touch detection, and after this you can take double or triple damage, its like its ignoring the table