so The reason why my script isn't working is because the (function(plr) isn't finding the players name so when it goes to set the items text but it doesn't know the players name to set the SlotUsed to Taken and the ItemName to Bottle Water

script.Parent.ClickDetector.MouseClick:connect(function(plr)
    if plr.PlayerGui.Inventory.Frame.Item1.SlotUsed.Value == "NonTaken" then
        plr.PlayerGui.Inventory.Frame.Item1.ItemName.Value = "Bottle Water"
    elseif
        plr.PlayerGui.Inventory.Frame.Item1.SlotUsed.Value == "Taken" and plr.PlayerGui.Inventory.Frame.Item2.SlotUsed.Value == "Nontaken" then
        plr.PlayerGui.Inventory.Frame.Item2.ItemName.Value = "Bottle Water"
    elseif
         plr.PlayerGui.Inventory.Frame.Item2.SlotUsed.Value == "Taken" and  plr.PlayerGui.Inventory.Frame.Item3.SlotUsed.Value == "NonTaken" then
        plr.PlayerGui.Inventory.Frame.Item3.ItemName.Value = "Bottle Water"
    elseif
        plr.PlayerGui.Inventory.Frame.Item3.SlotUsed.Value == "Taken" and plr.PlayerGui.Inventory.Frame.Item4.SlotUsed.Value == "NonTaken" then
        plr.PlayerGui.Inventory.Frame.Item4.ItemName.Value = "Bottle Water"
    elseif
        plr.PlayerGui.Inventory.Frame.Item4.SlotUsed.Value == "Taken" and plr.PlayerGui.Inventory.Frame.Item5.SlotUsed.Value == "NonTaken" then
        plr.PlayerGui.Inventory.Frame.Item5.ItemName.Value = "Bottle Water"
    elseif
        plr.PlayerGui.Inventory.Frame.Item5.SlotUsed.Value == "Taken" then
        script.Parent:Destroy()
    end
end)


4 comments

0

That looks perfectly fine. Are you sure all your paths are correct? What exact words do the output say?

0

nothing just whenever I go and click it nothing happens

0

the string value doesn't get set to the players name, the inventory system nothing happens to that

0

And there is nothing in the output stating that anything is wrong