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

How to let parts "push away" parts?

Asked by 6 years ago

If you don't know that what I'm saying,please check the game"Can you Survive a Tsunami?"(No link here because I don't want to make this question to an ad).I really like the tsunami script in that game,but I can't make the script myself.

0
This is not a request site, so I'm sorry, but you need to put something forth to get an answer. FlippinAwesomeCrew 62 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Something like this...?

part1 = script.Parent
part2 = script.Parent.Parent.UnanchoredPart
part1.Position = part2.Position + Vector3.new(15,0,0)
part1.CanCollide = false
part2.CanCollide = false
while true do
    for i = 1,10 do
        part1.Position.CFrame = CFrame.new(part1.Position - Vector3.new(1.5,0,0))
        if part1.Position == part2.Position then
            part2.Position.CFrame = CFrame.new(part1.Position + Vector3.new(10,0,0)
        end
    end
end

This would be the basic code for moving a Part away from a second Part. But, I don't know what you're talking about, and I wouldn't try to copy the script of that game. That's plagiarism.

Ad

Answer this question