I made a script that makes it where if you click on a GUI button it is supposed to clone a model from ServerStorage to Workspace but when I test the game, when I click on the button nothing happens and I see no errors. Could someone tell me why? This is the code I made.
local redMachineGun = game.ServerStorage.RedSoldiers.RedArcticSoldier
local clickDetector1 = game.StarterGui.ScreenGui.ScrollingFrame1.Machine.ClickDetector
local function clone1()
redMachineGun:Clone().Parent = workspace
end
function onMouseClick1()
clone1()
end
clickDetector1.MouseClick:connect(onMouseClick1)
