Im sorry, im not sure how to explain it but how do i make this script only do something when the the gui is clicked. Here so basically when a player clicks on a new skill and equips it in for example slot 1, it is equipped in slot 1, but when that player equips something slot 2 it just breaks. Im pretty sure i know why but im not good at explaining, or preventing
local keyWordTable = {
["AttackKey"] = Enum.KeyCode.E
}
local slot1connect, slot2connect
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Values.Triggered.Value = true
if slot1connect then slot1connect:Disconnect() end
if slot2connect then slot2connect:Disconnect() end
slot1connect = Slot1.MouseButton1Click:Connect(function()
keyWordTable["AttackKey"] = Enum.KeyCode.Q
end)
slot2connect = Slot2.MouseButton1Click:Connect(function()
keyWordTable["AttackKey"] = Enum.KeyCode.E
end)
end)
So like when i click the equip button for slot 1 the skill equips but when i equip a new skill in the same slot they just combine same with the other slot. Im pretty sure it’s because both scripts use the same equip menu to equip different skills
it’s just that when a player equips an item they both use the same gui and when they click the gui the skill’s script both combine, or something like that