#Model:PivotTo() Orientation
87 messages · Page 1 of 1 (latest)
In game
--Setting UP Script
local CX, CY, CZ = script.Parent.PrimaryPart.CFrame.X, script.Parent.PrimaryPart.CFrame.Y, script.Parent.PrimaryPart.CFrame.Z
local db = false
local Part = script.Parent
Part:PivotTo(CFrame.new(999999999,99999999999,99999999999))
--Setting Up Variables
local quan = 5
--local tim = 30
--local maxRng = 10
local tim = 1
local maxRng = 1
wait(5)
-- Checking if its a private server
local PRIVATE = game.Workspace.IsPrivate
if not PRIVATE.Value then
wait(tim + math.random(0,maxRng))
--Part:SetPrimaryPartCFrame(CFrame.new(CX, Part.PrimaryPart.CFrame.Y, Part.PrimaryPart.CFrame.Z))
--Part:SetPrimaryPartCFrame(CFrame.new(Part.PrimaryPart.CFrame.X,CY,Part.PrimaryPart.CFrame.Z))
--Part:SetPrimaryPartCFrame(CFrame.new(Part.PrimaryPart.CFrame.X,Part.PrimaryPart.CFrame.Y,CZ))
Part:PivotTo(CFrame.new(CX,CY,CZ))
--Touch event
Part.PrimaryPart.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr and db == false then
db = true
local Corns = plr:WaitForChild("Stats"):FindFirstChild("ccorn")
Corns.Value += quan
Part:PivotTo(CFrame.new(999999999999,99999999999,999999999999))
wait(tim + math.random(0,maxRng))
Part:PivotTo(CFrame.new(CX,CY,CZ))
db = false
end
end)
end
Script:
Dont use PivotTo()
then?
Use tween
huh
local tweenInfo = TweenInfo.new(0,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,0)
Like this?
i need to create 2 tweens
local tweenInfo = TweenInfo.new(0,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,0)
local tween1 = game:GetService("TweenService"):Create(PUT THE VARIABLE FOR THE INSTANCE U WANT TO TWEEN HERE., tweenInfo, {CFrame = CFrame.new()})
tween1:Play()
the instance is a model
works tho?
the primary part?
Yes
i will try
uhhhh
OKOKOKOKOKOKOKOK
Try this
local tweenInfo = TweenInfo.new(0,Enum.EasingStyle.Linear, Enum.EasingDirection.InOut,0,false,0)
for i, part in model:GetChildren() do
if part:IsA("BasePart") then continue end
local tween1 = game:GetService("TweenService"):Create(part, tweenInfo, {Position = Vector3.new()})
tween1:Play()
end
Uh
Now
then, i need to get all the parts vector3
Yea
Cuz CFrame changes orientation too
CFrame = CoordinateFrame
= Changes every coordinate to the give coordinate
Oki
for now, none errors in the console
And it works?
idk why is not working
It got deleted or it was tweened?
Do this with vector3 right?
yes
Just make 3 tweens, one for each and remove welds
there's a problem
i need to do the same with a Crate of Candy Corns
and the crate has like 50 parts-
@spiral granite so... Ima use again pivotTo
idc now abt orientations
i need to release the halloween update now
today*
Fling Simulator, why?