Hi! I’ve been working on a CAD system for quite some time now and i’ve run into a little problem. On my CAD, in the calls I have a “Delete” button, as seen below. Once it is clicked, it is supposed to delete that Frame for all users. However, I can’t find a way to do this as all frames are named the same and if I were to fire all clients and just delete the frame name, it’d delete a random call. I am extremely confused here.
Properties
My code ( as of now,) is below. It’s very messy.
Step 1: Delete button clicked.
for i,v in pairs(DispatchMF.Dashboard.Calls.Holder:GetChildren()) do
if not("UIListLayout") then
v.delete.MouseButton1Click:Connect(function()
v.Name = "Delete"
Functions.RemoveCall()
end)
end
end
Step 2: Function receives request
module.RemoveCall = function()
Events:WaitForChild("DeleteCall"):FireServer()
end
Step 3: Server receives request from function
Whenever I try to make 4 spaces, it just goes on a new line, i’m sorry!
game.ReplicatedStorage.ImprovedCAD.Events.DeleteCall.OnServerEvent:Connect(function(plr)
game.ReplicatedStorage.ImprovedCAD.Events:WaitForChild(“DeleteCall”):FireAllClients()
end)
Step 4: Client Fired
Events.DeleteCall.OnClientEvent:Connect(function()
DispatchMF.Dashboard.Calls.Holder.Delete:Destroy()
end)
--This won't work because only the one in that persons frame was named Delete, not anyone elses. What to do?
Any help is appreciated!