So basically, I use an playerAdded event, to check when someone joins. When they join the should get a GUI, but it seems like it doesnt work to get the player from the even to see the GUI.
Server script:
game.Players.PlayerAdded:Connect(function(player)
local key = tostring(player.UserId)
local LastLogin = DataStore:GetAsync(key)
local seconds = os.time()
local minutes = seconds/60
local hours = minutes/60
if DataStore then
if seconds >= 24 then
print(player.leaderstats.Points.Value)
local amount = math.random(85,100)
DataStore:SetAsync(key, os.time())
player.leaderstats.Points.Value = player.leaderstats.Points.Value + amount
game.ReplicatedStorage.DailyRewardSystem:FireClient(player, amount)
print(player.leaderstats.Points.Value .. " old")
print(amount)
end
else
DataStore:SetAsync(key, os.time())
end
end)
--Local script:
game.ReplicatedStorage.DailyRewardSystem.OnClientEvent:Connect(function(player, amount)
print(amount)
print(player)
player.PlayerGui.ScreenGui.PointsAwarded.Amount.Text = amount
player.PlayerGui.ScreenGui.PointsAwarded.Name.Text = ("Hey " .. player.Name .. "!")
player.PlayerGui.ScreenGui.PointsAwarded.Visible = true
wait(3)
player.PlayerGui.ScreenGui.PointsAwarded.Visible = false
end)
The players prints the amount and the amount is a nil value. How can I get the specific player that joined from the server to the client? Thanks.

5 comments
Do you think this will work? SInce I want the specific player that joined...
And when I remove the player argument from the :FireClient() it outputs; Unable to cast value to object...
You need to pass the player as first argument to FireClient
So i only need to pass the argument from the server, and then on client; get the local player?
yeah