You’re checking if Char.Name is equal to the table, which it obviously isn’t.
Replace your touched event with this:
Part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
for _,Char in pairs(hit.Parent:GetChildren()) do
if Char:IsA("MeshPart") then
Char.Transparency = 1
end
end
end
end)
-- ServerScript
local UIS = game:GetService("UserInputService")
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local SpawnLocation = game.Workspace:WaitForChild("SpawnLocation")
local tween = game:GetService("TweenService")
local LocalPlayers = game:GetService("Players")
local Explosion = game.Workspace:WaitForChild("explosion2")
local Debounce = false
local DoomEvent = game.ReplicatedStorage:WaitForChild("DoomSound")
RemoteEvent.OnServerEvent:Connect(function(player)
local Character = player.Character
local Part = Instance.new("Part")
local C4 = Instance.new("Explosion")
Part.Shape = Enum.PartType.Ball
Part.Material = Enum.Material.ForceField
Part.CFrame = SpawnLocation.CFrame
Part.Name = "IDK"
Part.Anchored = true
Part.CanCollide = false
Part.CastShadow = false
Part.Parent = game.Workspace.PT
local PartGoal = TweenInfo.new(5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0.2)
local PartProperty = {Size = Vector3.new(179, 179, 179), Color = Color3.fromRGB(229, 76, 0)}
local PartX = tween:Create(Part, PartGoal, PartProperty)
PartX:Play()
Explosion:Play()
Part.Touched:Connect(function(hit)
if Debounce == false then
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then
C4.BlastPressure = 20000
C4.BlastRadius = 20000
C4.Parent = Character.HumanoidRootPart
DoomEvent:FireAllClients()
Debounce = true
print(Debounce)
end
end
task.wait(5)
Debounce = false
print(Debounce)
Part:Destroy()
end)
end)
-- localscript
local UIS = game:GetService("UserInputService")
local RemoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local player = game.Players.LocalPlayer
local Doom = game.Workspace:WaitForChild("Explosion")
local DoomEvent = game.ReplicatedStorage:WaitForChild("DoomSound")
local MyID = 1533601134
local CanUse = false
local Character = player.Character
DoomEvent.OnClientEvent:Connect(function()
Doom:Play()
end)
UIS.InputBegan:Connect(function(Input, chat)
if Input.KeyCode == Enum.KeyCode.F and
player.UserId == MyID and
not chat and
CanUse == false then
print("Player Matched!")
RemoteEvent:FireServer()
for i = 0,25 do
CanUse = true
print("Please wait for " .. i)
task.wait(5)
CanUse = false
Doom:Stop()
end
end
end)