script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.Equipped.Value == false and game.Players.LocalPlayer.Inventory.Multi.Value == true then
local value = script.Parent.Parent
game.ReplicatedStorage.Delete.DeleteMult:FireServer(value)
end
end)
I’m not sure to be honest. Looks like it should work.
The most likely thing is that maybe you are sending the wrong data the second time around? Maybe you’re changing it elsewhere on accident? If possible, it might be helpful to include your client side code as well.
Also one cool thing about flipping booleans is that you can simplify it down to this instead of using if statements.
game.ReplicatedStorage.Delete.DeleteMult.OnServerEvent:Connect(function(plr,value)
value.Deleating.Value = not value.Deleating.Value
value.ImageButton1.Visible = value.Deleating.Value
end)
Is it possible that the remote isn’t firing once you change the value to true? Maybe try adding a print statement in your server sided code on the first line after OnServerEvent and seeing if it’s firing. I’m not too sure on how your system works and if something else happens once that value is set to true that would prevent it from being sent, so it’s not for sure but something to try. Maybe the if statement on the client is preventing it from firing after it’s been set to true.
I’m not sure the server script can actually reference what you are sending. I don’t generally change gui stuff from the server. It’s generally best to change it from a local script since the player can do that anyways. Going through the server will just cause unnecessary lag and might be the cause of your problem. Put it in your local script and tell the server of the change if necessary.
Basically change your local script to this
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.Equipped.Value == false and game.Players.LocalPlayer.Inventory.Multi.Value == true then
local value = script.Parent.Parent
value.Deleating.Value = not value.Deleating.Value
value.ImageButton1.Visible = value.Deleating.Value
--game.replicatedstorage.delete.deletemult:FireServer(value) --Tell the server what the new value is if necessary
end
end)
And remove that part of your server script since the local script handles it now.