When I change the XP value, the level up bar doesn't move at all. -Here is the Script for the frame.

repeat wait() until game.Players.LocalPlayer

local Player = game.Players.LocalPlayer 

local Data = Player:FindFirstChild("Data")
local XP = Data.XP
local Max_XP = 10000

while wait() do

local XPMat = ( XP.Value / Max_XP )
    script.Parent:TweenSize(UDim2.new(XPMat,0,1,0),"Out","Quad",.25)
end

-Here's the script for ServerScriptService

local Max_XP = 10000
local Max_Level = 150

game.Players.PlayerAdded:connect(function(Player)

    local Data = Instance.new("IntValue",Player)
    Data.Name = "Data" 
    local XP = Instance.new("IntValue",Data) 
    XP.Name = "XP" 
    XP.Value = 100
    local Level = Instance.new("IntValue",Data) 
    Level.Name = "Level" 
    Level.Value = 1 
    local Tries = Instance.new("IntValue",Data)
    Tries.Value = 10
    Tries.Name = "Tries"

    XP.Changed:connect(function() 
        XPChange(Player,XP,Level) 
    end)
end)

function XPChange(Player,XP,Level)
    if XP.Value >= Max_XP and Level.Value <= Max_Level then
        XP.Value = 0
        Level.Value = Level.Value + 1
   else
    return false;
    end
end

-My first script for Frame attempt

while true do
wait()
  local XP = script.Parent.Parent.Parent.Parent.Parent.Data.XP.Value
    local MaxXP = script.Parent.Parent.Parent.Parent.Parent.Data.Level.Value*150
      local math = ( XP / MaxXP )
        script.Parent:TweenSize(UDim2.new(math,0,1,0),"Out","Quad",.25)
end

10 comments

0

The first script is a local script correct ?

0

And remember to change value with server.

1

this guy clearly diddnt script it

0

also, don't use the parent argument of Instance.new

2

this script is from a tutorial

0

oof. can you just fix the script for me.

0

show that you attempted first if we just give you the fixed script we're not helping you

0

I have to mention that I got 90% of the script from a youtube video. Im trying to learn to script.

0

Downvoted for saying "can you just fix the script for me." And YouTube tutorials suck. They teach bad code.

0

what is downcoded