Help needed with Remote Events

Hello, im new to remote events. I’ve been trying to destroy a part with wich the player interacts with but it doesnt work.

Here are some screenshots:

Local Script
image
Server Script
image

I mark there what I think is the cause. I think the problem is in the second image wich is the server script, help will be apreciated

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Thanks, elpanlo

1 Like

You’re not passing the argument into the destroyItm() function. And you’re going to delete everything in the workspace if you run the code in destroyItm. Pass the values to the function, then destroy the item:

local function destroyItm(player, item)
    item:Destroy()
end
1 Like

Yeah, when I tested it it destroyed either the player or the worksapce.

Your solution works, thanks.