I would like the wedge to be replaced with all the parts which are in a model. How could i refer to multiple parts in a model?
local toggle = false
local ForceStop = -50
local StartForce = -5000
script.Parent.Wedge.Touched:connect(function(hitPart)
if toggle == false then
toggle = true
if hitPart == game.Workspace.Block or hitPart.Parent:FindFirstChild('Humanoid')then
local force = Instance.new("BodyForce")
force.Parent = hitPart
for i = 1,100 do
force.Force = Vector3.new(0,0,StartForce)-Vector3.new(0,0,i*ForceStop)
wait(0.01)
end
end
end
end)
script.Parent.TouchEnded:connect(function(hitPart)
if hitPart:FindFirstChild('BodyForce') then
hitPart.BodyForce:Destroy()
end
toggle = false
end)

1 comment
use for loop and get each child