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

Need help making a part clone another object?

Asked by
Or2no 30
5 years ago

I am trying to make a simple ball dispenser. I put the sphere in server storage to keep it out of the playing area. I want to set a part in my model to dispense a sphere every 3 seconds. I put print scripts to check if it works. The console does print the messages, but there are no sphere's spawning in the dispenser.

Here is my script, nothing happens. I wonder if my logic is wrong and the computer simply doesn't understand my order, or if my ball is in the wrong location.

01-- Variables
02 
03 Dispenser = script.Parent
04 
05 DispenserPosition = Dispenser.Position
06 
07 Ball = game.ServerStorage.Ball
08 
09 BallClone = Ball:Clone()
10 
11MyWorkspace = game.Workspace
12 
13 
14 
15 -- Cloning
View all 32 lines...

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

you never sets the balls parent try add this code:

1BallClone.Parent = game.Workspace

Also change:

1BallClone= DispenserPosition

to:

1BallClone.Position = DispenserPosition
Ad

Answer this question