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..'.'
I might have potentially found the error. While examining about the stuff in comments, I might have found the error. The problem is maybe TextLabel is not accepting number value. So, you have to convert it to string.
Here's what you must do:
function PreloadUI(XP,Cash) local Xp = tostring(XP) -- Convert XP to string local cash = tostring(Cash) -- Convert Cash to string print("Received order to change ",Player.Name,"'s CashText.Text from ",CashText.Text,' to ',Cash) print("Received order to change ",Player.Name,"'s XPText.Text from ",XPText.Text,' to ',XP) script.Parent.Left.Block.Frame.TextLabel.Text = ''..Xp..'.' script.Parent.Right.Block.Frame.TextLabel.Text = ''..cash..'.' end PreloadRewardUI.OnClientEvent:Connect(PreloadUI)
Lemme know if it helps!