Hello, I have this remote event and it passes an object when its clicked via a click detector. everything works good except for the fact that for some reason attributes arent passing through my remove event.
as you can see in my script:
-- // server
script.Parent:SetAttribute("Cash", 10)
game.ReplicatedStorage.RemoteEvent:FireClient(plr, script.parent)
-- // client
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(object)
print(object:GetAttribute("Cash")) -- // prints nil
end)
here is an example that I’m trying to do but for some reason I am unable to get the attribute from the param passed object.
I realized the issue was because I was passing the part that was being clicked and not the actual model (the model was the one with the attributes.) I do have to say I strongly disagree with your point.
Why you shouldnt use value objects
Attributes are faster
Attributes are cleaner
Attributes are better for managing. Ex: setattribute() only creates a new attribute if a old attribute doesnt exist with the same name.
Yeah, Attributes are superior to independent values. Once I learned about attributes I never looked back, as there isn’t really any reason to use independent values that couldn’t already be done in a simpler and more organized method with code or attributes.