I am working on updating my game, Ride a Box Into Shedletsky’s Face, and I want to know how I can make a button that explodes the player whenever they click it.
I’ve looked on YouTube, DevForum, Google, and some more Roblox Developer websites to find the answer but I’m not getting the same results I’m looking for.
Video of button:
The script:
local clicked = script.Parent.ClickDetector.MouseClick
local part = script.Parent
clicked:Connect(function()
part.Position = Vector3.new(2708.001, 18846.492, -1361.788)
part.BrickColor = BrickColor.new("Really red")
wait(1.6)
part.Position = Vector3.new (2708.001, 18846.492, -1361.936)
part.BrickColor = BrickColor.new("Lime green")
end)
Thanks, if anyone could help it would be appreciated.
I added in your explosion script without the debounce. Whenever I click it, it does nothing but what it did without an explosion script. It underlines character in blue.
local clicked = script.Parent.ClickDetector.MouseClick
local part = script.Parent
local explosion = Instance.new("Explosion", workspace)
clicked:Connect(function()
part.Position = Vector3.new(2708.001, 18846.492, -1361.788)
part.BrickColor = BrickColor.new("Really red")
explosion.Position = character:WaitForChild("HumanoidRootPart").Position
wait(1.6)
part.Position = Vector3.new (2708.001, 18846.492, -1361.936)
part.BrickColor = BrickColor.new("Lime green")
end)