In a localscript i have a remote event that fires to the server, remote events automatically make the player the first parameter so the script on the servers side has the player. However, when i run these scripts below:
local lvlup = game:GetService("ReplicatedStorage"):WaitForChild("RE"):WaitForChild("lvlup")
local lvlupreturn = game:GetService("ReplicatedStorage"):WaitForChild("RE"):WaitForChild("lvlupreturn")
local player = game.Players.LocalPlayer
local leaderboard = player:WaitForChild("leaderboard")
local XP = leaderboard.XP
local Lvl = leaderboard.Lvl
local XPreq = Lvl.Value*100
local function set()
value.Text = XP.Value .. " / " .. XPreq
script.Parent.Size = UDim2.new(XP.Value/XPreq,0,1,0)
end
local player = game.Players.LocalPlayer
local leaderboard = player:WaitForChild("leaderboard")
local XP = leaderboard.XP
local debounce = true
local function levelup()
if debounce == true then
debounce = false
lvlup:FireServer()
end
lvlupreturn.OnClientEvent:Connect(function()
set()
debounce = true
end)
end
XP:GetPropertyChangedSignal("Value"):Connect(function()
levelup()
end)
Server
local lvlup = game:GetService("ReplicatedStorage"):WaitForChild("RE"):WaitForChild("lvlup")
local lvlupreturn = game:GetService("ReplicatedStorage"):WaitForChild("RE"):WaitForChild("lvlupreturn")
lvlup.OnServerEvent:Connect(function(player)
local XP = player.leaderboard.XP
print(XP.Value)
lvlupreturn:FireClient(player)
end)
The server script always prints XP.Value as 0 even when it isnt

2 comments
it appears that there is no change occuring to the XP variable from scripts, is there some other way you are modifying it?
i changed it by going to the intvalue manually and changing it