📜  如何使用点击检测器 roblox 杀死类人机器人 - Lua 代码示例

📅  最后修改于: 2022-03-11 14:54:55.554000             🧑  作者: Mango

代码示例1
--Kill a humamanoid in Lua. Grepper doesn't support Lua so this is set to "Whatever"
game.Players.PlayerAdded:Connect(function(player) -- gets player
local detector = --Add detector here
local function onClicked()
    player.Character.Humanoid.Health = 0 --or whatever you want it to be
    --optional more code
end
    detector.MouseClick:Connect(onClicked)
end)