Answered by
4 years ago Edited 4 years ago
Hello again, I guess it's not solved so I'll help you out. The script isn't working because 1. the loop doesn't allow it to pass through the tween and 2. the tween will play to the original part, not cloned part. Fixing those problems isn't that hard. Here's an example how to result those problems.
01 | local Clickd = script.Parent.ClickDetector |
02 | local Button = script.Parent |
03 | local RS = game:GetService( "ReplicatedStorage" ) |
04 | local EndFolder = RS:WaitForChild( "End" ) |
05 | local Pillar = EndFolder.Pillar |
07 | local Baseplate = game.Workspace.Baseplate |
12 | local TweenService = game:GetService( "TweenService" ) |
13 | local TweeningInfo = TweenInfo.new( |
16 | Enum.EasingStyle.Quad, |
17 | Enum.EasingDirection.Out, |
24 | local PartProperties = { |
25 | Position = Vector 3. new( 0 , 250 , 0 ) |
30 | Clickd.MouseClick:Connect( function () |
31 | X = math.random(- 250 ,Radius) |
32 | Z = math.random(- 250 ,Radius) |
34 | ClonedPillar = Pillar:Clone() |
35 | ClonedPillar.Parent = workspace |
36 | ClonedPillar.Position = Vector 3. new(X, 52.171 ,Z) |
37 | Baseplate.BrickColor = BrickColor.new( "Brick yellow" ) |
38 | Baseplate.Material = Enum.Material.Slate |
40 | local Tween = TweenService:Create(ClonedPillar,TweeningInfo,PartProperties) |
42 | for i, v in pairs (game.Workspace:GetChildren()) do |
43 | if v.Name = = "Pillar" then |
Hopefully you understand it and have fun with this script!