ok so in my game i have it where it will make a "bluebarrel" and when it does it is supposed to put a "speedup" inside of it which works fine but it wont clone into the one that spawned it will clone into the one that is already in workspace,ignore the chance and powerupchance variables they are for later use
script:
workspace.ChildAdded:Connect(function(obj) if obj:IsA("UnionOperation") then if obj.Name == "BlueBarrel" then print("BlueBarrel Appeared") local Chance = math.random(1,5) local PowerupChance = math.random(1,5) local clone1 = game.ReplicatedStorage.SpeedUp:Clone() clone1.Parent = workspace clone1.Position = obj.Position end end end)
You are putting the speedup inside the workspace instead of the barrel. Here is the correct script:
workspace.ChildAdded:Connect(function(obj) if obj:IsA("UnionOperation") then if obj.Name == "BlueBarrel" then print("BlueBarrel Appeared") local Chance = math.random(1,5) local PowerupChance = math.random(1,5) local clone1 = game.ReplicatedStorage.SpeedUp:Clone() clone1.Parent = obj -- obj, not workspace clone1.Position = obj.Position end end end)