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

Part not going in position?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

Error in position

local part = Instance.new("Part",workspace)
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position=(0,0,0)

while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
end

4 answers

Log in to vote
0
Answered by 9 years ago

Lol, this was from my math.random explanation. But anyway, you need to change the value to either a Vector3, or a CFrame. If you're changing it to a CFrame, you'll need to access the CFrame property of the part.

Here:

local part = Instance.new("Part",workspace
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,0,0)

while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
end

TheDeadlyGuest4 said something similar, but his example was flawed with a lowercase "f" in "CFrame", and not changing the "part.Position" to "part.CFrame".

Ad
Log in to vote
0
Answered by 9 years ago

Does the part spawn in the middle? If so, Its because your position is set 0 0 0 which is in the middle of the baseplate for example, I can help you more if you give me more detail on how it is erroring.

Log in to vote
0
Answered by 9 years ago

You need to use vector3.new or CFrame.new

local part = Instance.new("Part",workspace
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position= CFrame.new(0,0,0)
while wait() do
    part.CFrame = part.CFrame * CFrame.Angles(0,0,1/10)
end

0
This won't work. You're not accessing the CFrame property of "part", and you spelled CFrame with a lowercase "f". CodingEvolution 490 — 9y
Log in to vote
0
Answered by
yoshi8080 445 Moderation Voter
9 years ago

This should work

local part = Instance.new("Part",workspace)
local d = Instance.new("Decal",part)

part.TopSurface="Smooth"
part.BottomSurface="Smooth"
part.Anchored=true
part.Size=Vector3.new(5,5,1)
part.CFrame=CFrame.new(0,50,0)
part.Position = Vector3.new(0,0,0)

while wait() do
    part.CFrame = part.CFrame+Vector3.new(0,0,1/10)
end

Answer this question