function OnHover(plr)
if script.Parent:FindFirstChild("SelectionBox") == nil then
f = Instance.new("SelectionBox")
f.Parent = script.Parent
f.Adornee = script.Parent
if script.Parent:FindFirstChild("Humanoid") == nil then
h = Instance.new("Humanoid")
h.Parent = script.Parent.Parent
h.MaxHealth = 0
h.Health = 0
script.Parent.Parent.Name = script.Parent.Parent.Name .. " [F]"
mouse = plr:GetMouse()
Slot1 = plr.PlayerGui.Inventory.Scrolling.Slot1
Slot2 = plr.PlayerGui.Inventory.Scrolling.Slot2
Slot3 = plr.PlayerGui.Inventory.Scrolling.Slot3
Slot4 = plr.PlayerGui.Inventory.Scrolling.Slot4
Slot5 = plr.PlayerGui.Inventory.Scrolling.Slot5
Slot6 = plr.PlayerGui.Inventory.Scrolling.Slot6
Slot7 = plr.PlayerGui.Inventory.Scrolling.Slot7
Slot8 = plr.PlayerGui.Inventory.Scrolling.Slot8
function Keys(key)
key:lower()
if key == "f" then
-- Having trouble with the code below.
if Slot1.Item.Value == "Nothing" or "Rock" then
Slot1.Image = "http://www.roblox.com/asset/?id=167139238"
Slot1.Item.Value = "Rock"
elseif Slot1.Item.Value ~= "Nothing" or "Rock" then
if Slot2.Item.Value == "Nothing" or "Rock" then
Slot2.Image = "http://www.roblox.com/asset/?id=167139238"
Slot2.Item.Value = "Rock"
elseif Slot2.Item.Value ~= "Nothing" or "Rock" then
if Slot3.Item.Value == "Nothing" then
Slot3.Image = "http://www.roblox.com/asset/?id=167139238"
Slot3.Item.Value = "Rock"
-- It stops here.
end
end
end
end
mouse.KeyDown:connect(Keys)
end
end
end
script.Parent.ClickDetector.MouseHoverEnter:connect(OnHover)
function OffHover()
if script.Parent:FindFirstChild("SelectionBox") ~= nil then
script.Parent.SelectionBox:remove()
if script.Parent.Parent:FindFirstChild("Humanoid") ~= nil then
script.Parent.Parent.Humanoid:remove()
-- if script.Parent.Parent.Name == "Rock [F]" then
script.Parent.Parent.Name = "Rock"
end
end
end
script.Parent.ClickDetector.MouseHoverLeave:connect(OffHover)
Now you see, the problem is, the image goes into the Gui and it goes in to all of them.
Anyone know a fix or maybe a way to add a table and test every slot to make sure it isn't equal to Rock or Nothing.

3 comments
You spelled SelectionBox wrong on line 2.
So I did. Thanks for noting that out. Can't believe I didn't notice that.
legoguy939: As a question asker, you should accept posts, even if you can't upvote them (green check mark)