``So here is the problem, Currently The gui lets you equip and item unequip, but if i were to try to equip it again than it dosent work, I will post the script bellow as well as an image of where the script is, its the local script. http://prntscr.com/97pes8
New Problem - Errors - Players.Player.PlayerGui.Shop/System.InventoryTab.Inventory.Item.EquipOrUnequip.LocalScript:10: attempt to index local 'cl' (a nil value)
script
player = game.Players.LocalPlayer
player:WaitForChild("leaderstats")
Cash = player.leaderstats.Money
tool = game.Lighting:findFirstChild("Sword")
function Check()
local cl = game.ServerStorage:FindFirstChild("Sword")
cl:Clone()
local player = game:GetService("Players").LocalPlayer
local Bought = script.Parent.Parent.HasBought
local EquipColor = BrickColor.new("Lime green")
local EquipColor2 = EquipColor.Color
local Equiped = script.Parent.Parent.IsEquiped
local UnequipedColor = BrickColor.new("Really red")
local UnequipedColor2 = UnequipedColor.Color
local find = player.Backpack:findFirstChild("Sword")
if Bought.Text == "False" then
cl.Parent = nil
script.Parent.HaventBot.Visible = true
wait(1)
script.Parent.HaventBot.Visible = false
elseif Bought.Text == "True" and Equiped.Text == "False" then
script.Parent.BackgroundColor3 = EquipColor2
script.Parent.Text = "Unequip"
cl.Parent = player.Backpack
Equiped.Text = "True"
elseif Bought.Text == "True" and Equiped.Text == "True" then
script.Parent.BackgroundColor3 = UnequipedColor2
script.Parent.Text = "Equip"
player.Backpack:findFirstChild("Sword"):Destroy()
Equiped.Text = "False"
end
end
script.Parent.MouseButton1Click:connect(Check)
######Mod Edit: Added code block - UrbanPatriot
