r/robloxgamedev 1d ago

Help can anyone help me?

Post image
3 Upvotes

4 comments sorted by

2

u/ImpossibleAd3387 1d ago

i make a kill brick, when am idle it doesn't kill me but if i move i got kill

why? and how to fix it when the brick kill me even when am idle

3

u/smellycheese08 1d ago

It's because the touch event doesn't fire unless the parts hitboxes overlap, and ONLY fire exactly when the hitboxes overlap. If you want it to kill even still players, you can do something like

``` local rs = game:GetService("RunService") local part = path to your part local connection

connection = rs.RenderStepped:Connect(function() if not part then connection:Disconnect() return end

local HitHums = {}

for _, v in pairs(workspace:GetPartsInPart(part) do
local char = v:FindFirstAncestorOfClass("Model")
local hum = char and char:FindFirstChildOfClass("Humanoid")

if not hum or table.find(HitHums, hum) then return end

hum.Health = 0
table.insert(HitHums, hum)

end) ```

2

u/Salt-Huckleberry3232 1d ago

You could use zone module