Hey.
I’ve had a small issue with spawning in.
The scripts should be clear enough.
issue: once the count is on 5, it’ll still continue and the count never resets.
--workspace handler
local count = 1
script.clockTimeEvent.Event:Connect(function()
repeat
game:GetService("ServerStorage").spawnAlien.Part:Clone().Parent = game:GetService("Workspace")
count += 1
print(count)
wait(1)
until count == 5
end)
--serverscriptservice script
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local WorkspaceService = game:GetService("Workspace")
local clockTimeEvent = WorkspaceService.WorkspaceHandler:WaitForChild("clockTimeEvent")
Lighting:GetPropertyChangedSignal("ClockTime"):Connect(function()
local clockTime = Lighting.ClockTime
if clockTime >= 11.9 and clockTime <= 12 then
clockTimeEvent:Fire()
print("Fired")
end
end)
Any help is appreciated.