Im trying to check if the value is changing, it doesn’t work unless I click another button, then it works.
local function updateTexture(newPetID)
petID = newPetID
repeat front.Texture = "rbxthumb://type=Asset&id="..petID.."&w=150&h=150" wait(.1) until front.Texture == "rbxthumb://type=Asset&id="..petID.."&w=150&h=150"
repeat back.Texture = "rbxthumb://type=Asset&id="..petID.."&w=150&h=150" wait(.1) until back.Texture == "rbxthumb://type=Asset&id="..petID.."&w=150&h=150"
end
plr.Data.PetID.Value.Changed:Connect(updateTexture)
local l = game.ReplicatedStorage:WaitForChild("Pet"):WaitForChild("Eggdog"):WaitForChild("Normal")
l.OnServerEvent:Connect(function(plr)
local thing = plr:WaitForChild("Data"):WaitForChild("PetID")
thing.Value = "12796463132" -- Primary ID
thing.Value = "12995552929" -- Decoy id
thing.Value = "12796463132" -- Primary ID
end)
I tried making a decoy ID but that doesn’t even work either
Why are you repeating texture assignment, I do not believe you need a loop for this.
When you set the value three times in a row like this, only one changed event will fire. There is not enough time between assignments for multiple .Changed to fire. Are you expecting to see the Decoy id?
There are two of these “Select” buttons,
When i click the first one it doesn’t appear sometimes, it 100% appears when i click the other one, I dont want that i want it to 100% work when i click it the first time
!!! THERE IS NO OUTPUT ERRORS, THAT IS ANOTHER SCRIPT THAT IM WORKING ON !!!
The docs say you want to use plr.Data.PetID.Changed:Connect can you make sure you are using a StringValue?
-- A StringValue stores one string
local vString = Instance.new("StringValue")
vString.Changed:Connect(print)
-- This fires Changed with "Hello" (not "Value")
vString.Value = "Hello"
That’s probably why it’s not working. When you start the game, it defaults to a value, and clicking the button “changes it” to that exact value, thus not firing .Changed or :GetPropertyChangedSignal. That sounds plausible considering the behavior you’re describing.
Ohhh! So you mean when i put it at one of those values, when i leave it saves to that value, and when i join back the value there is the same as that one, Though
when you set and set it back like that the client doesn’t see the in-between. It happens in the same “frame” so the server only sends the final value, which probably does not fire a Changed event if it’s the same.