I made a script that makes a noise and moves a model and whatnot, but when it is activated, the model stays put. The output does not tell me anything related to this script. Here is the script.
function separate()
if game.Workspace:FindFirstChild("Stardrive")== nil then
script.Parent.Sound.Pitch = 1
script.Parent.Sound:play()
wait(3)
local s = game.ServerStorage.Stardrive:clone()
s.Parent = game.Workspace
game.Workspace.Separated.Value = true
wait(0.5)
local p = game.Workspace.Stardrive:GetChildren()
repeat
wait(0.5)
for i,v in pairs(p) do
v.CFrame = v.CFrame + Vector3.new(0, 0, 10)
end
until
game.Workspace.Stardrive.Deflector.Position.Z <= 1728.95
else
if game.Workspace:FindFirstChild("Stardrive")~= nil then
script.Parent.Sound.Pitch = -1
script.Parent.Sound:Play()
game.Workspace.Separated.Value = false
game.Workspace.Stardrive:destroy()
end
end
end
script.Parent.ClickDetector.MouseClick:connect(separate)
Anyone know why it won't work?
