how to make a roblox game?
basic thing:
animation1st. add your npc model in the avatar!
2nd. add a script inside your npc model
3. use this following script
local npc = script.Parentlocal humanoid = npc:WaitForChild("Humanoid")local destination = Vector3.new(0, 0, 50) -- Change to your target position
humanoid:MoveTo(destination)
(make sure you made the animation! >*)
kill brick
1st create a part for your workspace!
2nd change the size or color or anything you want!
3rd add a script in the part
4th write the code and paste the following script
local part = script.Parent
local function onTouch(otherPart) local character = otherPart.Parent local humanoid = character:FindFirstChild("Humanoid")
if humanoid then humanoid.Health = 0 -- Instantly kills the player endend
part.Touched:Connect(onTouch)
DAmage brick
its similar to the kill brick BUT the scrips are
local damage = 25 -- Amount of damage to deallocal cooldown = 1 -- Time in seconds before damage can be dealt againlocal isTouching = false
script.Parent.Touched:Connect(function(hit) local character = hit.Parent local humanoid = character:FindFirstChild("Humanoid")
if humanoid and not isTouching then isTouching = true humanoid:TakeDamage(damage) task.wait(cooldown) -- Debounce to prevent instant death isTouching = false endend)
WELP! THATS ALL FOR THE BASIC COMMENT THIS POST FOR MORE! ⌓ ⌓
U
animation
2nd. add a script inside your npc model
3. use this following script
local npc = script.Parent
local humanoid = npc:WaitForChild("Humanoid")
local destination = Vector3.new(0, 0, 50) -- Change to your target position
humanoid:MoveTo(destination)
(make sure you made the animation! >*)
kill brick
1st create a part for your workspace!
2nd change the size or color or anything you want!
3rd add a script in the part
4th write the code and paste the following script
local part = script.Parent
(make sure you made the animation! >*)
kill brick
1st create a part for your workspace!
2nd change the size or color or anything you want!
3rd add a script in the part
4th write the code and paste the following script
local part = script.Parent
local function onTouch(otherPart)
local character = otherPart.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0 -- Instantly kills the player
end
end
part.Touched:Connect(onTouch)
DAmage brick
its similar to the kill brick BUT the scrips are
DAmage brick
its similar to the kill brick BUT the scrips are
local damage = 25 -- Amount of damage to deal
local cooldown = 1 -- Time in seconds before damage can be dealt again
local isTouching = false
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid and not isTouching then
isTouching = true
humanoid:TakeDamage(damage)
task.wait(cooldown) -- Debounce to prevent instant death
isTouching = false
end
end)
WELP! THATS ALL FOR THE BASIC COMMENT THIS POST FOR MORE! ⌓ ⌓
U
WELP! THATS ALL FOR THE BASIC COMMENT THIS POST FOR MORE! ⌓ ⌓
U
No comments:
Post a Comment