Hey guys, I tried making a currency pop up whenever you collect at XP orb and it worked, unfortunately it looked bland, so i tried adding some tweens.
I tried going for a dissolve type tween but it doesn’t work.
-Script That Receives The Event And Creates Reward.
local function CreateReward()
if player.Character.PrimaryPart:FindFirstChild(“Reward”) then
local T2 = TS:Create(player.Character.PrimaryPart:FindFirstChild(“Reward”).amount, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {TextTransparency = 0})
local T22 = TS:Create(player.Character.PrimaryPart:FindFirstChild(“Reward”).icon, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {ImageTransparency = 0})
player.Character.PrimaryPart:FindFirstChild(“Reward”).amount.Text = player.Character.PrimaryPart:FindFirstChild(“Reward”).amount.Text + tostring(10)
T2:Play()
T22:Play()
task.wait(4)
if player.Character.PrimaryPart:FindFirstChild(“Reward”) then
player.Character.PrimaryPart:FindFirstChild(“Reward”):Destroy()
else
–print(“Already Deleted”)
end
else
local Clone = Reward:Clone()
Clone.Parent = player.Character.PrimaryPart
Clone.Name = “Reward”
Clone.amount.Text = tostring(10)
local T2 = TS:Create(Clone.amount, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {TextTransparency = 0})
local T22 = TS:Create(Clone.icon, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {ImageTransparency = 0})
T2:Play()
T22:Play()
task.wait(4)
if Clone then
Clone:Destroy()
else
–print(“Already Deleted”)
end
end
endRS.Game.Events.RewardOrbSystem.OnClientEvent:Connect(function()
CreateReward()
end)
-And a Server Script that does the process.
local event = game:GetService(“ReplicatedStorage”).Game.Events.AwardXpParticle
local event2 = game:GetService(“ReplicatedStorage”).Game.Events.RewardOrbSystem
local Reward = game:GetService(“ReplicatedStorage”).Game.Assets.UI.Reward
local TweenService = game:GetService(“TweenService”)event.OnServerEvent:Connect(function(player)
player.Data.Exp.Value += 10
event2:FireClient(player)
end)
If you have a way to fix this please reply! Thank you.