they should remove an accessory called "acc" from the character but that error appeared in the output menu..so what to do ? (the remoteEvent called "remove" )
the localscript (inside a textbutton)
button = script.Parent rbl = game:GetService("ReplicatedStorage") remove = rbl.remove button.MouseButton1Click:Connect(function() remove:FireServer() end)
the server-sided script (serverscriptservice)
rblstorage = game:GetService("ReplicatedStorage") remove = rblstorage.remove remove.OnServerEvent:Connect(function(plr) local char = plr.Character local acc = char:FindFirstChild("acc") acc:Destroy() end)
Instance:remove()
. It is an old, deprecated method that existed before Instance:Destroy()
. When you do this:remove = rblstorage.remove
rblstorage:remove()
rblstorage.remove(rblstorage) -- not syntax sugar remove = rblstorage.remove -- acceptable remove(rblstorage) -- acceptable
You need to name the child of ReplicatedStorage something else. The problem you are encountering is that remove is a deprecated function in Roblox Lua. You are using a function on accident. A very simple solution would be to change the name of what I think is your remote event. What @incapaz did not understand is that you are using :Destroy() and that remove is the name of your remote event. What you did not know was that remove was actually a roblox function. Just change the name to something else. Hope this helps and have a great day scripting!