What the actual hell!
So, why the freak is this not working?
-- Script in SSS
if game:GetService("MarketplaceService"):PlayerOwnsAsset(CurrentPlayer, DoubleCoinGP) then
local RewardAmountDB = RewardedTime * 2
--CurrentPlayer.leaderstats.Cash.Value = CurrentPlayer.leaderstats.Cash.Value + RewardAmountDB
print(CurrentPlayer.Name,' has been rewarded ',RewardAmountDB,' cash')
CashToReward = CashToReward + RewardAmountDB
end
local RewardAmountDB = nil
if CurrentPlayer.MembershipType == Enum.MembershipType.Premium then
local RewardAmountDB = RewardedTime * 2
print(CurrentPlayer.Name,' has been rewarded ',RewardAmountDB,' cash')
--CurrentPlayer.leaderstats.Cash.Value = CurrentPlayer.leaderstats.Cash.Value + RewardAmountDB
CashToReward = CashToReward + RewardAmountDB
end
CashToReward = CashToReward + RewardedTime
print('CashToReward = ',CashToReward)
local XPTeReward = 0
if game:GetService("MarketplaceService"):PlayerOwnsAsset(CurrentPlayer, TwiceXP) then
XPTeReward = RewardedTime / 2
print(CurrentPlayer.Name,' has been rewarded ',math.round(RewardedTime / 1),' XP ')
else
XPTeReward = RewardedTime / 4
print(CurrentPlayer.Name,' has been rewarded ',math.round(RewardedTime / 2),' XP')
end
PreloadRewardUI:FireClient(CurrentPlayer,XPTeReward,CashToReward)
--LocalScript in GUI
function PreloadUI(XP,Cash)
print("Received order to change ",Player.Name,"'s CashText.Text from ",CashText.Text,' to ',Cash) -- (Output) Received order to change Player1 's CashText.Text from 999 to 23
print("Received order to change ",Player.Name,"'s XPText.Text from ",XPText.Text,' to ',XP) -- (Output) Received order to change Player1 's XPText.Text from 999 to 5.75
script.Parent.Left.Block.Frame.TextLabel.Text = ''..XP..'.' -- IT DOES NOT CHANGE THE TEXT. It just keeps saying 999
script.Parent.Right.Block.Frame.TextLabel.Text = ''..Cash..'.' -- NOR THESE TEXTS ARE CHANGED. It just keeps saying 999
end
PreloadRewardUI.OnClientEvent:Connect(PreloadUI)
So, anyone have a clue?
Edit:
This does not work too:
local NewCashText = Cash
local NewXPText = XP
print("Received order to change ",Player.Name,"'s CashText.Text from ",CashText.Text,' to ',NewCashText)
print("Received order to change ",Player.Name,"'s XPText.Text from ",XPText.Text,' to ',NewXPText)
script.Parent.Left.Block.Frame.TextLabel.Text = ''..NewXPText..'.'
script.Parent.Right.Block.Frame.TextLabel.Text = ''..NewCashText..'.'

6 comments
Made them both to 'Local Function', but did not fix it.
May I know these XP and Cash are numeric or string?
They are both Numbers
I've edited the post with some more context btw
Try using tostring(XP) and tostring(Cash)
What's Tostring? Can't find anything about that on Google nor Yahoo, lol