local gui = script.Parent
local players = game:GetService("Players")
local player = players.LocalPlayer
local run = game:GetService("RunService")
local sound = script.KillSound
gui.KillButton.MouseButton1Click:Connect(function()
local character = player.Character
if not character then return end
local head = character:FindFirstChild("Head")
if not head then return end
for _, v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") and v ~= character then
if (character.Head.Position - v.Head.Position).Magnitude <= 20 and v.Humanoid.Health > 0 and script.Parent.KillButton.Timer.Visible == false then
sound:Play()
v.Humanoid.Health = 0
character:MoveTo(v.HumanoidRootPart.Position)
script.Parent.KillButton.Timer.Visible = true
wait(1)
script.Parent.KillButton.Timer.Text = "9"
wait(1)
script.Parent.KillButton.Timer.Text = "8"
wait(1)
script.Parent.KillButton.Timer.Text = "7"
wait(1)
script.Parent.KillButton.Timer.Text = "6"
wait(1)
script.Parent.KillButton.Timer.Text = "5"
wait(1)
script.Parent.KillButton.Timer.Text = "4"
wait(1)
script.Parent.KillButton.Timer.Text = "3"
wait(1)
script.Parent.KillButton.Timer.Text = "2"
wait(1)
script.Parent.KillButton.Timer.Text = "1"
wait(1)
script.Parent.KillButton.Timer.Visible = false
break
end
end
end
end)
run.Heartbeat:Connect(function()
local character = player.Character
if not character then return end
local head = character:FindFirstChild("Head")
if not head then return end
local cankill = false
for _, v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") and v ~= character then
if (character.Head.Position - v.Head.Position).Magnitude <= 20 and v.Humanoid.Health > 0 and script.Parent.KillButton.Timer.Visible == false then cankill = true end
end
end
if cankill then
gui.KillButton.ImageTransparency = 0
else
gui.KillButton.ImageTransparency = 0.65
end
end)
Edit By JesseSong:
Please do not use deceitful means to get users to do your request. If you want to pay people to help you with your code you should make a portfolio in the Roblox Developer forums.
Make sure your question is paraphrased with a sentence explaining what is wrong and not working with the code. You can click on the hyperlink provided

2 comments
if this doesnt work then make sure you use the example above to adapt and learn C:
the gui part does not work as the script parent is sss instead of the gui. im not sure if this workbut what if i do "player.PlayerGui.GUI"