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
4 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.

-- Variables

 Dispenser = script.Parent

 DispenserPosition = Dispenser.Position

 Ball = game.ServerStorage.Ball 

 BallClone = Ball:Clone()

MyWorkspace = game.Workspace



 -- Cloning

 while Dispenser do

Dispenser.CanCollide = false

print('You can walk through me')

print(Dispenser.Position)




BallClone = DispenserPosition

wait(3)

  end

1 answer

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

you never sets the balls parent try add this code:

BallClone.Parent = game.Workspace

Also change:

BallClone= DispenserPosition

to:

BallClone.Position = DispenserPosition
Ad

Answer this question