sneakCheck.Touched:Connect(function()
if sneak == false then
--what do I put in here
end
end)
我想检查这个角色在偷袭被击中时是否在偷袭,如果是假的,他会死的。我该如何为他创建一个有价值的,这样我就可以很容易地引用他
-- Make your sneak animation or function or whatever that will determine its value
local sneak = false
-- Check if the object that it hit is a player (because it is triggered by anything that it hits)
sneakCheck.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health > 0 and sneak == false then
-- Kill the user
hit.Parent.Humanoid.Health = 0
end
end)
如果你还有其他问题,请告诉我。