I made a zombie tracker!
Thanks to ChatGPT for scripting this! And me for designing the UI. Source Code
-- Get references
local player = game.Players.LocalPlayer
local zombie = workspace:WaitForChild("Zombie") -- Your zombie's model
local zombieTrackerGui = player:WaitForChild("PlayerGui"):WaitForChild("ZombieTrackerGui")
local trackerLabel = zombieTrackerGui:WaitForChild("ZombieTrackerLabel")
local alertSound = trackerLabel:WaitForChild("AlertSound") -- Sound inside the label
-- Function to update the label color and sound based on distance
local function updateZombieTracker()
local playerChar = player.Character
if not (playerChar and playerChar:FindFirstChild("HumanoidRootPart")) then return end
local zombieHRP = zombie and zombie:FindFirstChild("HumanoidRootPart")
if not zombieHRP then return end
local playerPos = playerChar.HumanoidRootPart.Position
local zombiePos = zombieHRP.Position
local distance = (playerPos - zombiePos).Magnitude
if distance < 10 then
-- GRAVE Danger
trackerLabel.Text = "GRAVE"
trackerLabel.TextColor3 = Color3.fromRGB(150, 0, 0) -- Purple
alertSound.PlaybackSpeed = 3
elseif distance < 20 then
-- DANGER
trackerLabel.Text = "DANGER"
trackerLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
alertSound.PlaybackSpeed = 2
elseif distance < 50 then
-- MODERATE
trackerLabel.Text = "MODERATE"
trackerLabel.TextColor3 = Color3.fromRGB(255, 165, 0)
alertSound.PlaybackSpeed = 1.5
else
-- SAFE
trackerLabel.Text = "SAFE"
trackerLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
alertSound.PlaybackSpeed = 1
end
end
-- Start playing sound (if itâs not already)
if not alertSound.IsPlaying then
alertSound:Play()
end
-- Continuously update
game:GetService("RunService").Heartbeat:Connect(updateZombieTracker)
Setup Instructions
Insert a LocalScript in StarterPlayerScripts
Then copy paste the code from the Source Code into the LocalScript.
Name the LocalScript. âZombieTrackerScriptâ is preferrable.
Insert ZombieTrackerGui into StarterGui
Insert ZombieTrackerScript into StarterPlayerScript
I dont see why people are getting so mad over this, its a resource that you put out for free (you did use chatgpt but as long as you learn from it its fine imo).
keep making things buddy and also the next time you upload something like this, upload it in the #resources:community-resources category.
have fun!
Youâre telling me it actually takes effort to simply give a prompt to an AI so that it can do all the work for you? He did not make it using AI, the AI made it for him. Of course, iâm not saying using AI is a crime, iâm saying that youâre not gonna learn anything by just asking AI to do the job for you, so you can then publish it online for others to use.
it does take effort, yes, with simple scripts the ai is pretty much always accurate but you cant get complex scripts out of the ai unless you know coding yourself (and even then you might have to correct the code yourself.)
and you DO learn by asking the ai as it explains what it writes.
the problem is that you were unnecessarily mean (along with others), he published this for free, said that chatgpt helped and hes obviously a beginner, so you should be encouraging him not putting him down.
Thank you for sharing your implementation of the zombie tracker system. This is a great example of combining UI design and real-time scripting to create an immersive gameplay feature. The logic youâve implemented to vary the threat level based on proximity is intuitive and well-structured, and the use of both color changes and dynamic audio feedback (via PlaybackSpeed) provides a clear, multi-sensory indication of danger that players can quickly understand and react to.
Your use of RunService.Heartbeat ensures that the tracker updates consistently with the game loop, which is important for maintaining accuracy and responsiveness, especially in fast-paced gameplay scenarios. Additionally, your conditional checks to ensure both the player character and zombie references are valid are good defensive programming practices that help avoid runtime errors in edge cases, such as when characters havenât fully loaded.
From a design perspective, labeling threat levels as âSAFEâ, âMODERATEâ, âDANGERâ, and âGRAVEâ is both thematic and user-friendly. The color palette youâve chosen complements these labels well and enhances readability. I also appreciate the attention to detail with the alert sound systemâmodulating playback speed based on distance is a clever way to signal urgency without requiring visual attention, which can be critical during high-intensity moments.
For potential future improvements, you might consider:
Expanding the system to support tracking multiple hostile entities.
Integrating directional cues to indicate where the danger is coming from.
Using tweening for smooth color transitions to enhance visual polish.
Adding a configuration module to allow players or developers to easily adjust distance thresholds and feedback parameters.
Overall, this is a well-constructed system that demonstrates a solid understanding of Robloxâs scripting and GUI systems. Excellent work collaborating with ChatGPT on the logic, and your user interface design ties everything together nicely. Looking forward to seeing how this evolves or how others in the community build upon it!