local Part = script.Parent
local Event = game.ReplicatedStorage:WaitForChild("CloneEvent")
local Event2 = game.ReplicatedStorage:WaitForChild("DestroyEvent")
Event.OnServerEvent:Connect(function(Player)
Part.Touched:Connect(function(Part)
local humanoid = Part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
local PlayerGui = Player:WaitForChild("PlayerGui")
local Ping = PlayerGui.PingGui.MainFrame.Ping
local Clone = Ping:Clone()
Clone.Parent = Ping .Parent
Event2:FireClient()
end
end)
end)
In a local script I have
local Part = script.Parent
local Event2 = game.ReplicatedStorage:WaitForChild("DestroyEvent")
Event2.OnClientEvent:Connect(function(Player)
Part.Touched:Connect(function(Part)
local humanoid = Part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
local Script = script.Parent.Script
Script:Destroy()
end
end)
end)
Everything works beside tin the local script where it destroys the server script
There is an error that says that on where it fires the client in the server script it says “argument 1 missing or nil”