You can write your topic however you want, but you need to answer these questions:
-
What do I want to achieve?
An event that fires when the value of my exp changes. - What is the issue?
It prints this when the event fires
-
What solutions have I tried so far?
I couldn’t find tutorials about the issue
Remote Event Script
game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("Exp").OnServerEvent:Connect(function(Player, Label, Exp, Re, Filler, Level)
Label.Text = Exp.Value.."/"..Re
if Exp >= Re then
Level.Value += 1
end
Filler:TweenSize(UDim.new(0, Exp.Value/Re, 0, 13), "In", "Out", 0.5)
end)
Local script
local Background = Gui:WaitForChild("Background")
local Bfill = Background:WaitForChild("BFill")
local Filler = Background:WaitForChild("Filler")
local Experience = Background:WaitForChild("Experience")
local ProfilePicture = Background:WaitForChild("Pic")
local Player = game:GetService("Players").LocalPlayer
local Cash = Background:WaitForChild("Cash")
local Name = Background:WaitForChild("Name")
local leaderstats = Player:WaitForChild("leaderstats")
local Currency = leaderstats:WaitForChild("Currency")
local Exp = leaderstats:WaitForChild("Exp")
local Level = leaderstats:WaitForChild("Level")
local RequiredExp
local LevelUp = Background:WaitForChild("LevelUp")
--//Events
local Events = game.ReplicatedStorage:WaitForChild("Events")
local CashEvent = Events:WaitForChild("Cash")
local LevelEvent = Events:WaitForChild("Level")
local ExpEvent = Events:WaitForChild("Exp")
--//Script//--
Name.Text = Player.Name
ProfilePicture.Image = game.Players:GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
Cash.Text = Currency.Value.."$"
RequiredExp = (Level.Value * 10)
Experience.Text = Exp.Value.."/"..RequiredExp
Currency:GetPropertyChangedSignal("Value"):Connect(function()
CashEvent:FireServer(Player, Cash, Currency)
end)
Level:GetPropertyChangedSignal("Value"):Connect(function()
LevelEvent:FireServer(Player, LevelUp, Level)
end)
Exp:GetPropertyChangedSignal("Value"):Connect(function()
ExpEvent:FireServer(Player, Experience, Exp, RequiredExp, Filler, Level)
end)