Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does this script make all models go to the model this part is in?

I have this script:

i = 0
bullet = game.ServerStorage.caliberMark45GunBullet
while i == 0 do 
    local clone = bullet:Clone()
    clone.Parent = workspace
    clone.SetPrimaryPartCFrame(CFrame.new(script.Parent.Orientation.X - 0.374, script.Parent.Orientation.Y, script.Parent.Orientation.Z - 4.284))
    i = 1
end

Does anybody know why instead of making a bullet in front of this part, it teleports all models around the model this part is in?

1 answer

Because SetPrimaryPartCFrame is like the Main thing and it will teleport everything inside the model according to the Position you gave it

to move like one part inside the model do like

bullet.Part.CFrame = CFrame.new(script.Parent.Orientation.X - 0.374, script.Parent.Orientation.Y, script.Parent.Orientation.Z - 4.284)

3 comments

0

Thank you!

0

I have tried this: i = 0 bullet = game.ServerStorage.caliberMark45GunBullet while i == 0 do local clone = bullet:Clone() clone.Parent = workspace clone.Part.CFrame = CFrame.new(script.Parent.Orientation.X - 0.374, script.Parent.Orientation.Y, script.Parent.Orientation.Z - 4.284) i = 1 end but it still teleports all models to this part. Why?

0

Are all parts welded to eachother? If yes unweld. Also do you only need the part or the entire model

This discussion is preserved as it was. New answers, comments, and votes are closed.