I think you might want to WaitForChild them at the beginning of the script.
Plus, Use Individual If(s)
If I'm correct, Your script, it's like,
First if checks, no, second, no, third no, after all that, it goes to the else statement,
Sadly at the else statement,
You're setting the parents without a variable defined,
An "If" with an "ElseIf" and "Else"
It would only select "One" To do, First to Bottom.
First until 1 before bottom, fails, and at the bottom There's an Else, it would (ONLY) go with that else
So it means that the variable isn't even Declared by your Ifs
EDIT: This might be what i would do for a fix
01 | local CoinDropping = false |
03 | if CoinDropping = = false then |
05 | if script.Parent:FindFirstChild( "Coin1" ) then |
06 | coin 1 c = script.Parent.Coin 1 :Clone() |
07 | script.Parent.Coin 1. CFrame = script.Parent.PointL.CFrame |
08 | script.Parent.CoinBPos:Clone().Parent = script.Parent.Coin 1 |
09 | script.Parent.CoinMover:Clone().Parent = script.Parent.Coin 1 |
10 | script.Parent.Button.ClickDetector.MouseClick:connect( function () |
11 | script.Parent.Coin 1. CoinBPos:Destroy() |
15 | if script.Parent:FindFirstChild( "Coin2" ) then |
16 | coin 2 c = script.Parent.Coin 2 :Clone() |
17 | script.Parent.Coin 2. CFrame = script.Parent.PointL.CFrame |
18 | script.Parent.CoinBPos:Clone().Parent = script.Parent.Coin 2 |
19 | script.Parent.CoinMover:Clone().Parent = script.Parent.Coin 2 |
20 | script.Parent.Button.ClickDetector.MouseClick:connect( function () |
21 | script.Parent.Coin 2. CoinBPos:Destroy() |
25 | if script.Parent:FindFirstChild( "Coin3" ) then |
26 | coin 3 c = script.Parent.Coin 3 :Clone() |
27 | script.Parent.Coin 3. CFrame = script.Parent.PointL.CFrame |
28 | script.Parent.CoinBPos:Clone().Parent = script.Parent.Coin 3 |
29 | script.Parent.CoinMover:Clone().Parent = script.Parent.Coin 3 |
30 | script.Parent.Button.ClickDetector.MouseClick:connect( function () |
31 | script.Parent.Coin 3. CoinBPos:Destroy() |
35 | if script.Parent:FindFirstChild( "Coin4" ) then |
36 | coin 4 c = script.Parent.Coin 4 :Clone() |
37 | script.Parent.Coin 4. CFrame = script.Parent.PointL.CFrame |
38 | script.Parent.CoinBPos:Clone().Parent = script.Parent.Coin 4 |
39 | script.Parent.CoinMover:Clone().Parent = script.Parent.Coin 4 |
40 | script.Parent.Button.ClickDetector.MouseClick:connect( function () |
41 | script.Parent.Coin 4. CoinBPos:Destroy() |
45 | script.Parent.PointBoard.Points.Value = 0 |
46 | if coin 1 c then coin 1 c.Parent = script.Parent end |
47 | if coin 2 c then coin 2 c.Parent = script.Parent end |
48 | if coin 3 c then coin 3 c.Parent = script.Parent end |
49 | if coin 4 c then coin 4 c.Parent = script.Parent end |
50 | script.Parent.mainreset.Disabled = true end |
51 | script.Parent.mainreset.Disabled = false end |