So, I'm trying to make like a button that when pushed, will launch a little rocket through BodyForce.
local model = script.Parent
local button = model.Button
local cover = model.Cover
local rocket = model.Rocket
local opened = false
cover.ClickDetector.MouseClick:Connect(function() --don't mind this
if opened then
opened = false
print(opened)
cover.Orientation = Vector3.new(-15, 0, 0)
cover.Position = Vector3.new(250, 3.732, 249.871)
else
opened = true
print(opened)
cover.Orientation = Vector3.new(75, 0, 0)
cover.Position = Vector3.new(250.1, 4.143, 250.434)
end
end)
button.ClickDetector.MouseClick:Connect(function()
print("pushed")
local force = Instance.new("BodyForce", rocket)
force.Force = Vector3.new(0,100,0)
wait()
force:Destroy()
end)
