Ive been trying to get this script working for over 2 hours now and still no luck. Here is the pic of the explorer: https://imgur.com/a/dNzP29d and here is the script:
model = script.Parent.Parent.torpedoSpawn.torpeedo local backup = model:clone() torpedoSpawn = script.Parent.Parent.torpeedo model:Destroy() function onClicked() wait(1) model = backup:clone() model.Parent = game.Workspace model:makeJoints() model:SetPrimaryPartCFrame(torpedoSpawn.CFrame) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Can someone please show me how the correct way looks like. Thanks for your time.
I would store the CFrame and also fix
model = script.Parent.Parent.torpeedo local toorpedoSpawnCFRAME = model.torpeedoSpawn.CFrame local backup = model:clone() model:Destroy() function onClicked() wait(1) model = backup:clone() model.Parent = game.Workspace model:makeJoints() model:SetPrimaryPartCFrame(toorpedoSpawnCFRAME) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
You did toorpedoSpawn.toorpedo it was toorpedo.toorpedoSpawn Hope it works