I need help. I want this script to kill a player with a certain name when he touches a part. My script isn't working, there aren't any errors and the "1" prints fine.
local name = "Just_T0m" script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then print("1") local player = game.Players:GetPlayerFromCharacter(hit.Parent) local character = hit.Parent if player.Name == name then -- end end end)
The solution was adding the actual kill function lol
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local character = hit.Parent local name = "Just_T0m" if player.Name == name then hit.Parent:BreakJoints() end end end)