im trying to clone a part and put it in workspace. ( the part is located in serverstorage )
At first it didnt work. So i decided to test it out with another script and it worked.
here is the script:
local closeAnim = require(game.Workspace.door.Animator)
local debounce = false
local g1 = game.Workspace.gen1
local g2 = game.Workspace.gen2
local g3 = game.Workspace.gen3
local reloaded = game.Workspace.reloaded
local broken = game.Workspace.broken
local coolant = game.Workspace.coolantValue
local bullet = game.ServerStorage:WaitForChild('Rocket') --- Part i want to clone
function onClicked(playerWhoClicked)
script.Parent.Transparency=1
if g1.Value and g2.Value and g3.Value and reloaded.Value and coolant.Value then
print("ready to fire")
local save = bullet:Clone() --- problematic line
if broken.Value == false then
save.Parent = game.Workspace --- problematic line
local brokenChance = math.random(0,4)
game.ReplicatedStorage.CameraShake:FireAllClients()
game.Workspace["Wind Whoosh Sonic Boom Low End Impact 2 (SFX)"]:Play()
game.Workspace["Big Explosion"]:Play()
closeAnim.NewTween1:Play()
reloaded.Value = false
if brokenChance == 2 then
broken = true
game.ServerStorage.Fire.Parent = game.Workspace
game.Workspace.brokenPart.ProximityPrompt.Enabled = true
end
else
script.Parent.ProximityPrompt.ActionText = "Component not on or broken"
wait(2)
script.Parent.ProximityPrompt.ActionText = "Fire"
end
end
wait(.1)
script.Parent.Transparency=0
end
script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
code for the other script:
local cf = CFrame.new(-21.801, 1.5, 12.961)
local bullet = game.ServerStorage.cart
local debounce = false
script.Parent.ProximityPrompt.Triggered:Connect(function()
if debounce == false then
debounce = true
local save = bullet:Clone()
save.Parent = game.Workspace
wait(5)
debounce = false
end
end)
well there is part in the part which has a particle emmiter in it ( lets just call this part “particle” It worked. The part cloned and got put into workspace.but it was anchored and i didnt want it to be anchored. I unanchored particle and it stopped working from there. Im gonna try grouping everything and see if that works.
local closeAnim = require(game.Workspace.door.Animator)
local debounce = false
local g1 = game.Workspace.gen1
local g2 = game.Workspace.gen2
local g3 = game.Workspace.gen3
local reloaded = game.Workspace.reloaded
local broken = game.Workspace.broken
local coolant = game.Workspace.coolantValue
local bullet = game.ServerStorage:WaitForChild('Rocket') --- Part i want to clone
function onClicked(playerWhoClicked)
script.Parent.Transparency=1
if g1.Value and g2.Value and g3.Value and reloaded.Value and coolant.Value then
print("ready to fire")
if broken.Value == false then
local save = bullet:Clone()
save.Parent = workspace
warn("BULLET SUCCESSFULLY CLONED! PARENT IS: " .. save.Parent:GetFullName())
local brokenChance = math.random(0,4)
game.ReplicatedStorage.CameraShake:FireAllClients()
game.Workspace["Wind Whoosh Sonic Boom Low End Impact 2 (SFX)"]:Play()
game.Workspace["Big Explosion"]:Play()
closeAnim.NewTween1:Play()
reloaded.Value = false
if brokenChance == 2 then
broken = true
game.ServerStorage.Fire.Parent = game.Workspace
game.Workspace.brokenPart.ProximityPrompt.Enabled = true
end
else
script.Parent.ProximityPrompt.ActionText = "Component not on or broken"
task.wait(2)
script.Parent.ProximityPrompt.ActionText = "Fire"
end
end
task.wait(.1)
script.Parent.Transparency = 0
end
script.Parent.ProximityPrompt.Triggered:Connect(onClicked)
aight it’s unfortunate that no one has replied or provided the solution in around 19 days yet but have you tried setting the cframe of the rocket just incase it’s actually far away from the common boundaries of supposed spawn?