So, I made this script that once someone buys a Developer Product, it fires a remote event to the client that bought it. It will then tween down a UI that says thank you for your purchase.
I'm trying to make it say for example, if they bought 5000 cash, it would say thank you for purchasing 5000 cash. But its not working.
It just displays Nil on the UI
This is my client side code
--// Variables
local remote = game.ReplicatedStorage.BoughtProductMessage
local text = script.Parent.ProductName
remote.OnClientEvent:Connect(function(player, ProductName)
print("Recived.")
text.Text = tostring(ProductName)
script.Parent.Parent:TweenPosition(UDim2.new(0.5, 0,0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 1, false)
wait(5)
script.Parent.Parent:TweenPosition(UDim2.new(.5, 0,-0.2, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 1, false)
end)
This is PART of my server side code
if receipt.ProductId == FIVE_THOUSAND then
if stats ~= nil then
stats.Value = stats.Value + 5000
local bought = "5,000 Cash!"
remote:FireClient(player, bought)
print("Fired")
end
end

2 comments
make a if statement to see if it goes to the right player
It would better if u shown the whole part code to see where you have gone wrong