Search
 
SCRIPT & CODE EXAMPLE
 

LUA

roblox touch part kill script

local Part = script.Parent -- Assigning a variable to the part

Part.Touched:Connect(function(Object) -- Listening out for when the part is touched and if it is then we are given information about what object touched the part
	if Object.Parent:FindFirstChild("Humanoid") then -- Checking if it's a player (if the object was an arm then it would look into the parent and look for the humanoid)
		Object.Parent:FindFirstChild("Humanoid").Health = 0 -- Changes the health value in the humanoid to 0 so the player dies
	end -- The end of the if statement
end) -- The end of the function
Comment

PREVIOUS NEXT
Code Example
Lua :: lua hash table length 
Lua :: finding humanoid roblox. part 
Lua :: roblox lua how to apply gravity to a object 
Lua :: ex: CFrame to vector3 roblox lua 
Lua :: svelte template 
Lua :: while main.lua 
Lua :: Print when a player joined roblxo 
Lua :: lua patterns 
Lua :: roblox player left 
Lua :: how to see greatest value in a table lua 
Lua :: lua run string as code 
Lua :: Lua how to comment 
Matlab :: find duplicates in matlab arrauy 
Matlab :: matlab make symbolic matrix 
Matlab :: matlab stop running function 
Matlab :: how to multiply matrixes in matlab 
Basic :: visual basic get mouse position 
Basic :: JsonFileWrapper 
Elixir :: HTTPoison post json 
Elixir :: elixir format code 
Scala :: scala random number 
Scala :: scala merge list of strings 
Actionscript :: process.stdin.setRawMode(true) error 
Excel :: excel number of column 
Perl :: perl remove all whitespace 
Pascal :: pascal pause 
Powershell :: takeown command 
Gdscript :: godot saving enum names in variable 
Assembly :: using shape property in flutter for circular corner 
Assembly :: node js vulnerabilities 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =