Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My remote event script has errors but doesnt show them?

Asked by
3F1VE 257 Moderation Voter
3 years ago

So I have scripts in my game that have's the client send over the fps every second to the server but it doesn't seem to work local script parent : replicatedfirst script parent : serverscriptservice local script :

01local player = game.Players.LocalPlayer
02local rstorage = game:GetService("ReplicatedStorage")
03local event = rstorage:WaitForChild("Event")
04local RunService = game:GetService("RunService")
05local TimeFunction = RunService:IsRunning() and time or os.clock
06local LastIteration, Start
07local FrameUpdateTable = {}
08local function HeartbeatUpdate()
09    LastIteration = TimeFunction()
10    for Index = #FrameUpdateTable, 1, -1 do
11        FrameUpdateTable[Index + 1] = FrameUpdateTable[Index] >= LastIteration - 1 and FrameUpdateTable[Index] or nil
12    end
13    FrameUpdateTable[1] = LastIteration
14    local fps = tostring(math.floor(TimeFunction() - Start >= 1 and #FrameUpdateTable or #FrameUpdateTable / (TimeFunction() - Start))) .. " FPS"
15    Start = TimeFunction()
View all 21 lines...

script :

1local rstorage = game:GetService("ReplicatedStorage")
2local event = rstorage:WaitForChild("Event")
3event.OnServerEvent:Connect(function(player,fps)
4    player.Character.Head.BillboardGui.Frame.Time.Text = tostring(fps)
5end)

If someone could help I would appreciate it a lot!

0
FYI time is just a placeholder 3F1VE 257 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Try changing your line 5 to

1local TimeFunction = RunService:IsRunning() and time or os.clock()
Ad
Log in to vote
0
Answered by 3 years ago

well, if you want to debug it, put print("what line your on") after every line and see whats wrong, or just press the go to script error button, it sucks i know, but you gotta do it

Answer this question