game.Workspace.FallenPartsDestroyHeight = -10000
local part = Instance.new("Part")
part.Size = Vector3.new(100, 2, 100)
part.Name = "AntiAutoKill"
part.Parent = game.Workspace
part.Anchored = true
local player = game.Players.LocalPlayer
local pl = player.Character or player.CharacterAdded:Wait()
-- Set the position of the part
part.Position = Vector3.new(-897.6600952148438, -650.0717163085938, -709.875732421875)
-- Teleport the player to the top of the part (offset the height by half the part's size)
local offset = Vector3.new(0, part.Size.Y / 2 + 5, 0) -- Adding 5 to ensure player is above the part
pl.HumanoidRootPart.CFrame = part.CFrame + offset
wait(1)
local player = game.Players.LocalPlayer
local character = player.Character
local rootPart = character.HumanoidRootPart
local originalPosition = rootPart.Position
local shopItem = game.Workspace.Ignored.Shop["[Pumpkin Mask] - $60"]
-- Move to shop item's position
rootPart.CFrame = shopItem.Head.CFrame + Vector3.new(0, 3, 0)
if (rootPart.Position - shopItem.Head.Position).Magnitude <= 50 then
wait(0.2)
fireclickdetector(shopItem:FindFirstChild("ClickDetector"), 4)
-- Return to original position
rootPart.CFrame = CFrame.new(originalPosition)
end
wait(5)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local stompedPlayers = {}
-- Function to check if the player is being grabbed
local function isGrabbed(player)
local character = player.Character
return character and character:FindFirstChild("HumanoidRootPart")
and character:FindFirstChild("Humanoid")
and character:FindFirstChild("Head")
and character:FindFirstChild("GRABBING_CONSTRAINT")
end
-- Function to get an instance in the workspace
local function getNil(name, class)
for _, v in pairs(getnilinstances()) do
if v.ClassName == class and v.Name == name then
return v
end
end
end
-- Function to reset a player when they respawn
local function resetPlayerOnRespawn(player)
player.CharacterAdded:Connect(function()
stompedPlayers[player.UserId] = false -- Reset stomp state on respawn
end)
end
-- Listen for new players and reset their state
Players.PlayerAdded:Connect(function(player)
stompedPlayers[player.UserId] = false -- Set initial stomp state for new players
resetPlayerOnRespawn(player)
end)
-- Handle existing players when the script starts
for _, player in pairs(Players:GetPlayers()) do
stompedPlayers[player.UserId] = false -- Initialize stomp state for existing players
resetPlayerOnRespawn(player)
end
-- Ensure the player only gets stomped once per KO, and reset on respawn
task.spawn(function()
while task.wait(1) do
for _, player in pairs(Players:GetPlayers()) do
if player.Character and player ~= LocalPlayer then
local bodyEffects = player.Character:FindFirstChild("BodyEffects")
if bodyEffects and bodyEffects:FindFirstChild("K.O") and bodyEffects["K.O"].Value == true
and not isGrabbed(player) and not stompedPlayers[player.UserId] then
-- Mark the player as stomped
stompedPlayers[player.UserId] = true
-- Move to player to stomp them
local lastPos = LocalPlayer.Character.HumanoidRootPart.Position
LocalPlayer.Character:MoveTo(player.Character.UpperTorso.Position)
task.wait(1)
LocalPlayer.Character:MoveTo(lastPos)
end
end
end
end
end)
-- Keep sending the "Stomp" event
RunService.RenderStepped:Connect(function()
local args = {
[1] = "Stomp",
[2] = {
["Ignored"] = {
[1] = workspace.Ignored
}
},
[3] = getNil("Stomp", "AnimationTrack"),
[4] = LocalPlayer.Character:WaitForChild("BodyEffects")
}
game:GetService("ReplicatedStorage").MainEvent:FireServer(unpack(args))
end)
wait(1)
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while task.wait(1) do
-- Check if the local player is K.O.
local localBodyEffects = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("BodyEffects")
if localBodyEffects and localBodyEffects:FindFirstChild("K.O") and localBodyEffects["K.O"].Value == true then
LocalPlayer:Kick("safe")
end
end
To embed this project on your website, copy the following code and paste it into your website's HTML: