GUI Button does nothing. No error or anything just nothing happens?
Title pretty much says it. Had an old code that was having an error I could not for the life of me figure out why it was occurring there was just no reason it should have been happening. So I made code a little more inefficient but should work because I have done it before. Well now the button does nothing. I tried adding prints throughout to see if it stops somewhere but nothing like it does nothing at all and I can't figure out why. Here's the code:
01 | local but = script.Parent |
02 | local gun = but.Parent.Weapon.Value |
03 | local wep = game.ReplicatedStorage.Weps |
04 | local player = game.Players.LocalPlayer |
05 | local pack = player.Backpack |
07 | but.MouseButton 1 Click:connect( function () |
08 | if gun.Value = = "MP5K" then |
09 | local clone 1 = wep.MP 5 K:clone() |
11 | elseif gun = = "M4" then |
12 | local clone 1 = wep.M 4 :clone() |
14 | elseif gun = = "Glock 17" then |
15 | local clone 1 = wep.Glock 17 :clone() |
17 | elseif gun = = "AK-12" then |
18 | local clone 1 = wep.AK 12 :clone() |
Like is this normal to just have a button do absolutely nothing? This is a local script in the button.