How do I make a fling barrier?
This is my current code:
wait()
p = game.Players.LocalPlayer
if p.Name ~= "SebbyTheGODKid" then script:Destroy() end
game.Players.LocalPlayer.CharacterAdded:Connect(function(char)
local b = Instance.new("Part", char)
b.Size = Vector3.new(15,15,15)
b.CanCollide = false
b.Transparency = 1
b.Anchored = true
b.Locked = true
b.Touched:connect(function(hit)
if hit:FindFirstChild("Humanoid") and not hit.Parent.Name == "SebbyTheGODKid" then
hit.Parent.Humanoid.Sit = true
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = Vector3.new(math.random(),math.random(),math.random())
bv.Parent = hit.Parent.HumanoidRootPart
end
end)
while wait() do
b.CFrame = char.HumanoidRootPart.CFrame
end
end)
But it doesn't work.
