function Purchase(tbl)
local cost = tbl[1]
local item = tbl[2]
local stats = tbl[3]
stats.Value = stats.Value - cost
--Objects[item.Object.Value].Parent = script.Parent.PurchasedObjects
local ob = Objects[item.Object.Value]
ob.Parent = script.Parent.PurchasedObjects
for i,v in pairs(ob:GetChildren()) do
if v:IsA('Part') or v:IsA('UnionOperation') then
ob.Parent = script.Parent.PurchasedObjects
local firstsize = v.Size
local firstpos = v.Position
v.Size = Vector3.new(0,0,0)
-- v.Position = firstpos - Vector3.new(0,20,0)
local Info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local Goals = {
Transparency = 0;
Size = Vector3.new(firstsize);
Position = Vector3.new(firstpos)--;
}
local tween = Ts:Create(v,Info,Goals)
tween:Play()
wait(1.5)
v.CanCollide = true
end
end
if Settings['ButtonsFadeOut'] then
item.Head.CanCollide = false
coroutine.resume(coroutine.create(function()
for i=1,20 do
wait(Settings['FadeOutTime']/20)
item.Head.Transparency = item.Head.Transparency + 0.05
end
end))
else
item.Head.CanCollide = false
item.Head.Transparency = 1
end
end
It clones the model and then makes the parts stay 0,0,0(.1,.1,.1)
it makes all the parts go to position 0,0,0)
why does it do this?
This siggy is classified | R$6,620 |