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

How do I make a part move using a script inside of it? [closed]

Asked by 5 years ago

So im making a gun and it transfers a movement script I'm not sure how to make the bullet move tho so im looking for someone that knows a script

0
use raycasting or bodyforces? RetroGalacticGamer 331 — 5y
0
Scripting Helpers is noit a request site. DeceptiveCaster 3761 — 5y
0
not* DeceptiveCaster 3761 — 5y

Closed as Not Constructive by DeceptiveCaster and theking48989987

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
0
Answered by
s_iara 94
5 years ago
Edited 5 years ago

--Put this script inside your part --Make sure it's a regular script though

local bullet = script.Parent

--to make it move

for i = 0.1,.01 do
bullet:SetPrimaryPartCFrame(bullet:GetPrimaryPartCFrame() * CFrame.new(0,0,-i))
wait()
end

--to make it stop [optional]

while wait() do
bullet:SetPrimaryPartCFrame(bullet:GetPrimaryPartCFrame() * CFrame.new(0,0,0 +1))

end?

--Good luck --You should try it out too because I'm not sure it works 100%

Ad