solved, thanks for trying to help
You’re trying to update the Frame from the Server when it should be done on the Client. When you fire the event to unequip the shirt, instead of changing the color on the server, change it on the client right after you fire the event.
How would I change the frame’s color back to the old color (unequipped color)? But I haven’t had any problems changing it on the server.
Could you also supply the updated code of the server?
Send the code for the client where you fire the event.
Here is an example:
...
Uniform:FireServer(...)
Frame.BackgroundColor3 = Color3.fromRGB(..., ..., ...)
That’s what you want to do instead.
But the thing is, that would change the color of framer only once am I right?
Although, I want change it multiple times, to the default color and the equipped color
It would change the frame every time you fire the event.
Client:
for _, button in ipairs(script.Parent.UI.Pages.Backpack_NEW.Uniforms.Main2.List.Scroll:GetDescendants()) do
if button:IsA("TextButton") then
button.MouseButton1Click:Connect(function()
game:GetService("ReplicatedStorage").Uniform:FireServer(button.Uniform.Shirt.ShirtTemplate, button.Uniform.Pants.PantsTemplate, button.Parent)
print("Sent to server.. picking up remote")
end)
end
end
for _, button in ipairs(script.Parent.UI.Pages.Backpack_NEW.Uniforms.Main2.List.Scroll:GetDescendants()) do
isEquipped = not isEquipped
if button:IsA("TextButton") then
button.MouseButton1Click:Connect(function()
game:GetService("ReplicatedStorage").Uniform:FireServer(button.Uniform.Shirt.ShirtTemplate, button.Uniform.Pants.PantsTemplate, button.Parent)
if isEquipped == true then
-- Change frame color
elseif isEquipped == false then
-- Change frame color
end
print("Sent to server.. picking up remote")
end)
end
end
Also, how do I solve my main question?
Just track the current one that is equipped through a variable and when you equip a new one, unequip the old one and make the new one the value of the variable.
local currentShirt
Event:FireServer(...)
-- do stuff with the currentShirt
currentShirt = ... -- the new shirt
Something like that.