I tried FireClient I used Fire:Client for the server with values (player, stat, amoun), but when using print I saw that the values are coming wrong and some null
Server code:
local ReplicadeStorage = game:GetService("ReplicatedStorage")
local Events = ReplicadeStorage.ManualTraining
local ShowGui = Events.ShowGui
local function increaseStats(player,Amount,Stat)
while TrainModule.GetTraining(player)["Training"] == true do
wait(1)
if ServerData[player.UserId] == nil then
else
ServerData[player.UserId]["Stats"][""..Stat]["Value"] = ServerData[player.UserId]["Stats"][""..Stat]["Value"] + 50
ShowGui:FireClient(player,Amount,Stat)
print(ServerData[player.UserId]["Stats"][""..Stat]["Value"])
end
end
end
Obs: the stat = “Endurance”, and Amount = 50 (ik beacause i already printed, and the value is correct)
But on my local script inside TextLabel
local ReplicadeStorage = game:GetService("ReplicatedStorage")
local Events = ReplicadeStorage.ManualTraining
local ShowGui = Events.ShowGui
local function guiPoints(player,amount,stats)
local pos1 = math.random(140,500)
local pos2 = math.random(109,250)
print(amount) //Here
script.Parent.TextLabel.Text = tostring(50)
script.Parent.TextLabel.Position = UDim2.new(0,pos1,0,pos2)
script.Parent.TextLabel.Visible = true
wait(0.50)
script.Parent.TextLabel.Visible = false
end
ShowGui.OnClientEvent:Connect(guiPoints)
Is printing that
where was to be the value of Amount is sending the name of the Stats, where was to be the Stats is sending the player, and where was to be the player is sending Nil (i know because i printed all values)