I am trying to create a entity that dashes through the middle of the map and there are sides that are safe as I want it to be in the same Y pos as the player and because the player goes deeper in this rng generated map. Can someone help.
local Players = game:GetService("Players")
local Rep = game:GetService("ReplicatedStorage")
local Blaze = Rep.Blaze
local BlazeP = Blaze["Blaze Part"]
local SafePart = Blaze.SafePart
local SafePart1 = Blaze.SafePart1
function SpawnBlaze(player)
local character = player.Character
if not character then return end
local hrp = character:FindFirstChild("HumanoidRootPart")
if not hrp then return end
workspace.Warnings["Blaze - Warning"]:Play()
local playerY = hrp.Position.Y
local BlazeClone = BlazeP:Clone()
BlazeClone.Position = Vector3.new(0, playerY, 0)
local SafePClone = SafePart:Clone()
SafePClone.Parent = workspace
SafePClone.Position = Vector3.new(0, playerY, 0)
local SafePClone1 = SafePart1:Clone()
SafePClone1.Parent = workspace
SafePClone1.Position = Vector3.new(0, playerY, 0)
task.wait(4.5)
BlazeClone.Parent = workspace
BlazeClone.Touched:Connect(function(hit)
local humanoid = hit.Parent and hit.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.Health > 0 then
humanoid.Health = 0
end
end)
end
--while true do
-- wait(math.random(45, 145))
-- for i, player in pairs(Players:GetPlayers()) do --SYSTEM - WHEN WORKING!
-- SpawnBlaze(player)
-- end
--end
for i, player in pairs(Players:GetPlayers()) do
SpawnBlaze(player)
end
Yes, but the safe parts don’t determine where the player is safe in the script. It is possible to be outside the safe zone and not die, or be inside and die, because it relies on .Touched
Whats in the output? Any errors? Also, pairs() are not needed.
Hi, im not talking about comments, im talking about this thing called the output. Do yk where print stuff shows? That thing. If theres something wrong then there will be an error. Can u send a pic?
Also there isn’t any movement here, is that intended? I think it is spawning but at (0, playerY, 0) so that if the player is at (100, 5, 100) then it will spawn 100 blocks away