📜  获取点击 clickdetecter roblox 的玩家 - Lua 代码示例

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

代码示例2
-- I've explained how to use click detectors, go to the link i have sourced before reading this (if you get confused)

local clickdetector = script.Parent --(assuming you put the detector inside a part)
local part = clickdetector.Parent --(assuming again you have the detector inside a part)

clickdetector.MouseClick:Connect(function(userThatClicked)
    print(userThatClicked.." has clicked this part!")
    part:Destroy() -- deletes the part
end)