Roblox Script snippets #1: Lav en fælde

Nederst i indlægget her finder du min kode til at lave fælder i Roblox Studio.

Hvis du vil se hvordan jeg laver dem, så kan du gøre det i videoen her

Mit fælde script

local function trapTouched(otherPart)
	local otherParent = otherPart.Parent
	local humanoid = otherParent:FindFirstChildWhichIsA("Humanoid")
	
	if humanoid then
		humanoid.Health = 0
	end
	
end

local trap = script.Parent
trap.Touched:Connect(trapTouched)

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *