when i load the game in the roblox game client(not studio) the “proper tween” for experience does not save, but the experience value does… as you can see in the picture below. Am I even on the right track or do I need to do something different here? This is what happens before I add the remote event, however when i add the remote event in, the exp bar shows 0 as a default, because there is an error…
I have been working out the kinks on this, integrating DataStore and testing in the client, etc.
I got an error I cannot seem to figure out.
13:58:02.728 ServerScriptService.DataStore:20: attempt to index nil with ‘Size’ - Server - DataStore:20
13:58:02.729 Stack Begin - Studio
13:58:02.729 Script ‘ServerScriptService.DataStore’, Line 20 - function updateUI - Studio - DataStore:20
13:58:02.729 Stack End - Studio
suggestions?
Server side
function updateUI(player, expValue, TweenValue, textValue)
currentExp = expValue
over.Size = TweenValue
text.Text = textValue
end
-- ON PLAYER ADDED --
game.Players.PlayerAdded:Connect(function(player)
uiEvent.OnServerEvent:Connect(updateUI)
client side
function update()
currentExp = exp.Value/maxExp.Value
over.Size = UDim2.new(currentExp,0,1,0)
text.Text = math.floor(currentExp * 100).. "%"
end
updateUI:FireServer(exp.Value/maxExp.Value, UDim2.new(currentExp,0,1,0), math.floor(currentExp * 100).. "%" )
exp.Changed:Connect(function()
if exp.Value > maxExp.Value then
leftOverExp = exp.Value - maxExp.Value
exp.Value = leftOverExp
playerLevel.Value = playerLevel.Value + 1
LevelEvent:FireServer(playerLevel.Value)
maxExp.Value = maxExp.Value * 1.25
end
testEvent:FireServer(exp.Value)
updateUI:FireServer(exp.Value/maxExp.Value, UDim2.new(currentExp,0,1,0), math.floor(currentExp * 100).. "%" )
end)

