Hi I am trying to clone a model from replicated storage and spawn it in the game at a certain point, but it only spawns the spider once and doesn't spawn it in the right position. Here is my code
local offset = Vector3.new(0,0,5) while true do wait() if myHuman.Health <= 250 then outerStomach.Transparency = 1 splat:Play() scream:Play() boomAnim:Play() for i = 1,5 do local spider = game.ReplicatedStorage:FindFirstChild("Spider") local spiderclone = spider:Clone() spiderclone.Parent = workspace spiderclone.Cframe = outerStomach.Cframe*offset print("Spawned") end break end end
on line 13
spiderclone.Cframe = outerStomach.CFrame*offset
capital CFrame
local offset = Vector3.new(0,0,5) myHuman.Changed:Connect(function() if myHuman.Health <= 250 then outerStomach.Transparency = 1 splat:Play() scream:Play() boomAnim:Play() for i = 1,5 do local spider = game.ReplicatedStorage:FindFirstChild("Spider") local spiderclone = spider:Clone() spiderclone.Parent = game.Workspace spiderclone.Cframe = outerStomach.Cframe*offset --Not sure if this is a part or a model but if it's a model, make sure to to get the main part of the spider so it can CFrame hope print("Spawned") end end end)
I changed some things, not sure about the CFrame spider thing though since I don't know if "spiderclone" is a part or a model. Hope this helps