Where is “ViewItem” supposed to be? inside the player like this?
change your code to this:
game.ReplicatedStorage.Remotes.BuyItem.OnServerEvent:Connect(function(thisplr)
local finditem = thisplr:FindFirstChild("ViewItem")
if not finditem then print("cannot find ViewItem inside the player") return end
local newskin = Instance.new("StringValue")
newskin.Name = finditem.Value
newskin.Parent = thisplr.EventItemsValuesFolder
print("Recieved!")
end)
the error means that “viewitem” is not found inside the player
That means that you didnt spell the name of the value the exact same . make sure the capitals and spelling in the code is the exact same as the value inside the player
Thank you so much it works now, could u help me with 1 more thing please?
Im having a problem whenever someone buys the item the new Value name is supposed to be the “ViewItem” .Value = “ITEMNAME” but when the person buys the item it create the name is Blank and it dosent add the items name (idk if that made sense or not )
A better example is that the item name that goes in to datastore of the bought item is blank when a script is suposed to get the ViewItem.Value as the name of the value but its not
game.ReplicatedStorage.Remotes.BuyItem.OnServerEvent:Connect(function(thisplr)
local finditem = thisplr:FindFirstChild("ViewItem")
if not finditem then print("cannot find ViewItem inside the player") return end
local newskin = Instance.new("StringValue")
newskin.Name = finditem.Value
newskin.Value = finditem.Value
newskin.Parent = thisplr.EventItemsValuesFolder
end)
the viewItem value name dosent change and the value is the item name but when i buy the item and add a new value to the eventfolder the name and value is blank
so when i click on the item i want it dont buy right then but it adds a value to the player that is the name “Viewitem” and the value as the item im looking at but when i buy the item the new value is blank
Sorry, but do you mind giving me access to the game? If your not comfortable that’s fine but it’s just hard to troubleshoot when I can’t see the rest of the code, or how the values are changing.