Part that change gravity and animation while in touch.
I have problem that gravity change sometimes (to different gravity that I didn’t add) and the animation don’t work somehow (the animation are fine)
function onTouch(hit)
if hit.Parent:findFirstChild("Humanoid") ~= nil then
local h = hit.Parent:findFirstChild("Humanoid")
hit.Parent.Animate.fall.FallAnim.AnimationId = "rbxassetid://9994619922"
end
end
script.Parent.Touched:connect(onTouch)
script.Parent.Transparency = 1
parent = script.Parent
function onTouch(hit)
if hit:FindFirstChild("NoGrav") == nil then
local bf = Instance.new("BodyForce")
bf.Name = "NoGrav"
bf.Parent = hit
bf.Force = Vector3.new(0,hit:GetMass(0),0)*workspace.Gravity
end
end
parent.Touched:connect(onTouch)
The scripts in different parts in workspace, but I can change if its help.