I am doing tests for a gun making simulator and I need a button to remotely detonate it, but the script I made won't work. It is in a local script and it does not give me any errors.
local Explosive = game.Workspace.Model.Mechanism
local Screen = Instance.new("ScreenGui")
local Button = Instance.new("TextButton")
Screen.Parent = game.StarterGui
Button.Parent = Screen
Button.Text = "FIRE!!"
Button.Position = UDim2.new(0, 50, 0, 100)
Button.Size = UDim2.new(0, 80, 0, 50)
Button.BackgroundColor3 = Color3.new(200,0,0)
function explode()
local ex = Instance.new("Explosion")
ex.BlastPressure = 99999999
ex.BlastRadius = 50
ex.Parent = Explosive
ex.DestroyJointRadiusPercent = 0
ex.Position = Explosive.Position
end
wait(1)
Button.MouseButton1Down:connect(explode)
