How to Make a Monster That Moves When You Blink in Roblox!
Автор: SharkSkatey Dev
Загружено: 2025-12-11
Просмотров: 190
Описание:
LocalScript = local frame = script.Parent:WaitForChild("BlinkFrame")
while true do
-- Random time before blinking again
local waitTime = math.random(3, 6)
task.wait(waitTime)
-- Blink closes
frame.BackgroundTransparency = 1
frame.Visible = true
-- Fade to black
for i = 1, 10 do
frame.BackgroundTransparency = frame.BackgroundTransparency - 0.1
task.wait(0.01)
end
-- Hold blink for a tiny moment
task.wait(0.1)
-- Fade open again
for i = 1, 10 do
frame.BackgroundTransparency = frame.BackgroundTransparency + 0.1
task.wait(0.01)
end
frame.Visible = false
-- Trigger monster event
game.ReplicatedStorage:WaitForChild("BlinkEvent"):FireServer()
end
Script = local monster = workspace:WaitForChild("BlinkMonster")
local humanoid = monster:WaitForChild("Humanoid")
local blinkEvent = game.ReplicatedStorage:WaitForChild("BlinkEvent")
-- How close the monster moves per blink
Discord = / discord
local stepDistance = 5
blinkEvent.OnServerEvent:Connect(function(player)
local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if not root then return end
-- Calculate direction toward the player
local dir = (root.Position - monster.HumanoidRootPart.Position).Unit
-- Move monster closer ONLY during the blink
monster.HumanoidRootPart.CFrame = monster.HumanoidRootPart.CFrame + (dir * stepDistance)
end)
game:GetService("RunService").Heartbeat:Connect(function()
for _, player in pairs(game.Players:GetPlayers()) do
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if root then
local cam = workspace.CurrentCamera
local origin = cam.CFrame.Position
local direction = (monster.HumanoidRootPart.Position - origin).Unit * 200
local raycast = workspace:Raycast(origin, direction)
if raycast and raycast.Instance:IsDescendantOf(monster) then
humanoid.WalkSpeed = 0
else
humanoid.WalkSpeed = 0
end
end
end
end)
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: