Sorry if its hard to undestand , I used Google Translator for make that :3
This is the first time I do something with filtering enabled, I have no idea what to use on certain occasions then i am having some troubles, I did 1 script that creates in ServerStorage a folder with the basic values to make a Health Bar ( Max Health and Health )
Leaderstats script :
game.Players.PlayerAdded:connect(function(Player)
local Folder = Instance.new("Folder" , game.ServerStorage)
Folder.Name = Player.Name
PlayerStats = {"Health" , "MaxHealth"}
PlayerStatsValues = {100,100}
ValuesTypes = {"IntValue" ,"IntValue"}
AllValues = {}
for i = 1,#PlayerStats do
local Value = Instance.new(ValuesTypes[i])
Value.Parent = Folder
Value.Value = PlayerStatsValues[i]
Value.Name = PlayerStats[i]
table.insert(AllValues , Value)
end
for i,Value in pairs(AllValues) do
Value.Changed:connect(function()
game.ReplicatedStorage.Remotes.StatsEvent:FireAllClients(Value.Name , Value.Value)
end)
end
end)
I rarely use tables but since I'm doing my first game I wanted to make things easier to edit and not make 1000 lines for make player stats.
From that moment things have complicated, I tried to give the information to the serverevent to transfer it to StarterGui to modify the bar of life to the desired value, I did it manually and I modified the value in Solo Mode, it works perfectly well, but when using Multiplayer it is not able to do anything, I tried to do the same thing but I used the function OnClientEvent and FireAllClients, I thought it would work if I specify which player would have the modified life bar and so could make a player list with life of all players, but nothing happened.
StarterGui Script with OnClientEvent :
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
--// Services
local ReplicatedStorage = game:GetService('ReplicatedStorage')
--//Remotes
local Remotes = ReplicatedStorage:WaitForChild('Remotes')
local StatsEvent = Remotes:WaitForChild('StatsEvent')
--// Guis
local Class = script.Parent:WaitForChild('Class')
local Stats = script.Parent:WaitForChild('Stats')
StatsEvent.OnClientEvent:Connect(function(player,Request,Num)
if Request == "Health" then
Player.StarterGui.Stats.Health.HealthBar:TweenSize(UDim2.new(Num/100,0,0,10),"Out", "Linear",0.1)
end
end)
No error occured with these scripts, they just do not work and I need help to make the life bar work. A good explanation can help me a lot to do the rest of the work.
Another thing I do not know how to do in Filtering Enabled :
How i change the player value in the folder

3 comments
Well , i my "PlayerGui" name in script is named "StarterGui" , But that was not the gltch , and you script it not perfect have some erros in strings , but i fixed they , but you made me fix it and i learned new things , Thanks alot :D , and i dont speak Spanish XD
rip English
oh RIP, sorry. I'm glad I helped :D