How to make a server script destroy on the client side through the server script

local Part = script.Parent
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

Event.OnServerEvent:Connect(function(Player) 
	Part.Touched:Connect(function()
		local PlayerGui = Player:WaitForChild("PlayerGui")
		local Ping = PlayerGui.PingGui.MainFrame.Ping
		local Clone = Ping:Clone()
		Clone.Parent = Ping	.Parent
		script:Destroy()
	end)
end)

So basically it deletes for the whole server. How do I make it so it deletes for the client but though the server script and not from a separate local script?

3 Likes

you could use a local script to receive a OnClientEvent and destroy the script using the local script, im pretty sure its impossible to delete it locally if u dont use a local script

2 Likes

This is impossible, you need to use a LocalScript.

1 Like

fire a clientevent with the same Remote and delete the script there.

1 Like

Use a RemoteEvent. In the Part.Touched script instead of destoying the script, fire the remoteEvent to the client of Player. In starterPlayerScripts make a localscript and listen for ClientEvents from the remoteEvents and then destroy the part. You can’t change things on a client only from the server nor can you the other way around. But i don’t see why you wouldn’t want to use another localscript.