String value connected to the player shows up on client side but when I click server its not in there, making my pet not show up at all. my script is located in a local script inside a Gui
What is the issue?
No pet shows up in pet-inventory when trying to equip due to string value not working correctly
What solutions have you tried so far?
Re wrote the same script 10x times and its not that, I think It has to do with I’m using a local script to try to ping server to update but with the wrong type of script. I have 0 errors
local petVal = Instance.new("StringValue")
petVal.Name = pet.Name
petVal.Parent = player.PetInventory
If the Client is creating the StringValue object, the server wouldn’t have a copy of it. Which would result in “nil” on the server.
You can pass in the StringValue.Value, and have the server compare it in some logic and act on what to do next.
Use a RemoteFunction if you want the server to return an object after passing in the value from the client. Keep in mind, if you do return a new object to the client, the client would need a copy. So clone whatever object off the server into ReplicatedStorage. So the client can have a copy of the object.