For some reason my remote event runs twice idk why, please help me.
local script:
checkAutoDelete.OnClientEvent:Connect(function(button)
if script.Parent:FindFirstChild(button).AutoDelete.Visible == true then
local autoDelete = true
backToServerAutoDelete:FireServer(autoDelete)
elseif script.Parent:FindFirstChild(button).AutoDelete.Visible == false then
local autoDelete = false
backToServerAutoDelete:FireServer(autoDelete)
end
end)
part of the serverscript:
checkAutoDelete:FireClient(player,button)
backToServerAutoDelete.OnServerEvent:Connect(function(player,autoDelete)
openBox:FireClient(player,button,boxName,autoDelete)
if autoDelete == false then
local newButton = Instance.new("StringValue")
newButton.Name = button
newButton.Value = button
newButton.Parent = player.ButtonInventory
newButton:SetAttribute("MoneyMultiplier",game:GetService("ReplicatedStorage").Boxes:FindFirstChild(boxName):FindFirstChild(button):GetAttribute("MoneyMultiplier"))
end
end)
can you add two prints? one behind backToServerAutoDelete:FireServer(autoDelete) in the local script and another at the beginning of the OnServerEvent connection and see what happens?