I'm probably gonna feel really stupid when someone answer this. Why wont this work? It wont give the cloned weapon to the player who clicked the TextButton.
main = script.Parent yesButton = main.yes weapon = game.Lighting.TrenchGun main2 = main.Parent open = game.Workspace.Shotgun.open ---------------------- yesButton.MouseButton1Click:connect(function(clicked) print("Local player has pressed Yes") clicked = game.Players.LocalPlayer weapon:Clone().Parent = clicked.Backpack open.Value = false main2:Destroy() game.Workspace.Shotgun:Destroy() end)
mmmm
local player = game.Players.LocalPlayer local gui = script.Parent local button = gui.yes button.MouseButton1Down:connect(function() local ewep = game.Lighting.TrenchGun:Clone() ewep.Parent = player.Backpack -- The rest of your code will error if Workspace.Shotgun = nil so if Workspace:FindFirstChild("Shotgun") then Workspace.Shotgun.open.Value = false Workspace.Shotgun:Destroy() script.Parent.Parent:Destroy() end end)