Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how can i get parts to to shoot out in random directions? [closed]

Asked by 6 years ago

3
No description? No help. Zafirua 1348 — 6y

Closed as Not Constructive by Zafirua and User#19524

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Griffi0n 315 Moderation Voter
6 years ago
Edited 6 years ago
local Interval = 1 -- Your Interval
local Velocity = 2 -- Your Velocity
local StartPosition = Vector3.new(0, 20, 0) -- Your Start Position

while true do
    local RandomAngle = Vector3.new(math.random(-360, 360), math.random(-360, 360), math.random(-360, 360))
    local Part = Instance.new("Part")
    local BodyVelocity = Instance.new("BodyVelocity")
    Part.Orientation = RandomAngle
    Part.Position = StartPosition
    BodyVelocity.Velocity = RandomAngle*Velocity
    BodyVelocity.Parent = Part
    Part.Parent = workspace
    wait(Interval)
end
Ad