This is a LocalScript, right? Also is the Changed event for a NumberValue?
No it is a server script. And yea it’s for a number value.
Why are you having a server script edit client objects?
I wanted it server because I wanted it to display for everybody but now I realize it doesn’t really matter if it is on the server or not because it will still display.
Yes, also the server should only have to do the bare minimum. That includes handling remotes, secure data, and only things a server can do. The client should handle everything else.
Anyway, try this:
local players = game:GetService('Players')
local localPlayer = players.LocalPlayer
local typewrite = require(game:GetService('ReplicatedStorage').typewrite)
local StatusGui = localPlayer.PlayerGui:WaitForChild("StatusGui")
local Status = StatusGui.MainFrame.Status
local Temp = workspace.Temp
local debounce
Temp:GetPropertyChangedSignal('Value'):Connect(function()
if not debounce then
debounce = true
local Value = Temp.Value
if Value > 3500 then
typewrite(Status,"WARNING. ACTIVATE THE COOLANT IMMEDIATELY! CORE IS NEAR MELTDOWN!",0.05)
elseif Value > 3000 then
typewrite(Status,"The core is starting to overheat. You should cool the core down a bit.",0.05)
elseif Value > 1500 then
typewrite(Status,"Core is at normal tempatures.",0.05)
elseif Value > 500 then
typewrite(Status,"The core is getting too cold. You should warm the core up.",0.05)
end
debounce = nil
end
end)
1 Like
So pretty much all I needed was a debounce and LocalScript? Thanks.
1 Like