Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't the script find the players name?

Asked by
Prioxis 673 Moderation Voter
10 years ago

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)


0
That looks perfectly fine. Are you sure all your paths are correct? What exact words do the output say? Shawnyg 4330 — 10y
0
nothing just whenever I go and click it nothing happens Prioxis 673 — 10y
0
the string value doesn't get set to the players name, the inventory system nothing happens to that Prioxis 673 — 10y
0
And there is nothing in the output stating that anything is wrong Prioxis 673 — 10y

Answer this question