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

Very simple script, I'm probably doing something stupid?

Asked by 8 years ago

I'm making a coin pusher. Don't judge me.

Anyways, I'm trying to make it so when you click the brick, a coin pops down underneath it. I was going to change the position later but can't even get this beginnings of it to work yet. Here's what I have so far.

Insert = script.Parent

function onClicked()
            Coin = Instance.new("Part")
            Coin.Shape = ("Cylinder")
            Coin.Size = Vector3.new(0.2, 2, 2)
            Coin.Position = Vector3.new(-13, 81, -10.3)
            Coin.Reflectance = 0.61
            Coin.Name = "Working"
            wait(1)
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

No output, nothing happens when clicked.

0
You did not parent the part. koolkid8099 705 — 8y

1 answer

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

You made a simple mistake! You never parented it! Add Coin.Parent = Workspace after line 9!

0
Ahh I knew it was something I had missed! Thanks! Tradesmark 65 — 8y
Ad

Answer this question