local p = 100
local d = 0
local rand = math.random
function fling(hit)
local char = hit.Parent
if char:FindFirstChild("Humanoid") then
local body = Instance.new("BodyPosition")
body.Position = Vector3.new(rand(d,p),rand(d,p),rand(d,p))
body.MaxForce = Vector3.new(p, p, p)
body.Parent = char.HumanoidRootPart
wait(.1)
body.Parent = nil
end
end
script.Parent.Touched:Connect(fling)
I have the script parented to the part but it doesn't fling me when I step on it. I've tried many other fling scripts online but they also don't seem to work either, here's another one I tried:
local n = 100
local rand = math.random
local function fling(hit)
local char = hit.Parent
if char:FindFirstChild("Humanoid") then
char.HumanoidRootPart.Velocity = Vector3.new(
rand(-n, n),
rand(-n, n),
rand(-n, n))
n = n/10
char.HumanoidRootPart.RotVelocity = Vector3.new(
rand(-n, n),
rand(-n, n),
rand(-n, n)
)
end
end
script.Parent.Touched:Connect(fling)

2 comments
Last line (19) should be :Connect(fling(hit).
Nope, it tells me that there's an unknown global called "hit". Just calling fling is fine because there's no parameter being passed in.