I made a code but it's not working. There's a place in the studio which has the cancollide property false.I added this script in but it's not working.How can I make it work?It works in Studio but not in Player
function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild("Humanoid") if h~=nil then if (h.Parent.Torso.Velocity.y < 44) then h.Parent.Torso.Velocity=Vector3.new(0,h.Parent.Torso.Velocity.y+25,0) end end end end script.Parent.Touched:connect(onTouched)
What errors do you have?
You need to do some basic debugging before coming here.
Change it to this:
function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild("Humanoid") if h~=nil then print('Humanoid is not nil') if (h.Parent.Torso.Velocity.y < 44) then print('Humanoid Torso velocity is below 44!') h.Parent.Torso.Velocity=Vector3.new(0,h.Parent.Torso.Velocity.y+25,0) print('Changed velocity!') end end end end script.Parent.Touched:connect(onTouched)
Tell me if it says: 'Humanoid is not nil', 'Humanoid Torso velocity is below 44!', and Changed velocity!
Press F9 while in game, see if there are any errors, and if so write them here. If no errors tell me if it says all of the above statements