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

How Do I make a while true loop Fire on a Remote Event?

Asked by 5 years ago

This is for a health billboard gui and i tweened it so that it changes but I want the textlabel to change also as the health and max health changes and I want it to show for everyone using remote events but it does not work any fix?

local script

local Player = game.Players.LocalPlayer
local ServerStorage = game:GetService("ServerStorage")
local BillBoard = script.Parent
local RemoteEvent = BillBoard:WaitForChild('HPEVENT')
local Red = BillBoard.REDNess
local Green = Red.GreenESS
local TextLabel = BillBoard.TextLabel
local Character = Player.Character
local Humanoid = Character.Humanoid

Humanoid.HealthChanged:Connect(function(HP)
    RemoteEvent:FireServer(HP)


end)



script

local ServerStorage = game:GetService("ServerStorage")
local BillBoard = script.Parent
local RemoteEvent = BillBoard:WaitForChild('HPEVENT')
local Red = BillBoard.REDNess
local Green = Red.GreenESS
local TextLabel = BillBoard.TextLabel
local Char = script.Parent.Parent.Parent
local Hum = Char:FindFirstChild('Humanoid')
local LabelText = script.Parent.TextLabel





RemoteEvent.OnServerEvent:Connect(function(player,HP)
     if HP then

            Red:TweenSize(UDim2.new(HP/Hum.MaxHealth,0,1,0))

            end




end)


0
Any errors? Where are the scripts located? Optikk 499 — 5y
0
The scripts are located beneath the billboard gui User#22788 5 — 5y

1 answer

Log in to vote
0
Answered by
3ora 54
5 years ago
Edited 5 years ago

Q:How Do I make a while true loop Fire on a Remote Event?

A:

while true do
 remoteeventhere:FireServer(arguements)
end
Ad

Answer this question