Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tweening Level Gui Breaks when filtering enabled?

Asked by
Jirozu 71
7 years ago

So, recently i learned how to use FE. I learned Changing the players Data through the server, and creating a part. But i need help with making a GUI that tweens with the players data (Ill go through further explanation if you dont understand what im saying.) How do i fix this?

DATA SCRIPT:

game.Players.PlayerAdded:connect(function(Player)
    --\\Something to hold the data in
    local Data = Instance.new("IntValue",Player)
    Data.Name = "Data"
    --\\Strength
    local StrengthEXP = Instance.new("IntValue", Data)
    StrengthEXP.Name = "StrengthEXP" 
    StrengthEXP.Value = 0
    local Strength = Instance.new("IntValue", Data)
    Strength.Name = "Strength"
    Strength.Value = 1 
    --\\Agility
    local AgilityEXP = Instance.new("IntValue", Data)
    AgilityEXP.Name = "AgilityEXP"
    AgilityEXP.Value = 0
    local Agility = Instance.new("IntValue", Data)
    Agility.Name = "Agility"
    Agility.Value = 1
    --\\Mastery
    local MasteryEXP = Instance.new("IntValue", Data)
    MasteryEXP.Name = "MasteryEXP"
    MasteryEXP.Value = 0
    local Mastery= Instance.new("IntValue", Data)
    Mastery.Name = "Mastery"
    Mastery.Value = 1
    --\\Rage
    local RageEXP = Instance.new("IntValue", Data)
    RageEXP.Name = "RageEXP"
    RageEXP.Value = 0
    local Rage = Instance.new("IntValue", Data)
    Rage.Name = "Rage"
    Rage.Value = 1
    --\\Stamina
    local Stamina = Instance.new("IntValue", Data)
    Stamina.Name = "Stamina"
    Stamina.Value = 100
    --\\Gender
    local Gender = Instance.new("IntValue", Data)
    Gender.Name = "Gender"
    Gender.Value = 0
    --\\Hair
    local Hair = Instance.new("IntValue", Data)
    Hair.Name = "Hair"
    Hair.Value = 0
    --\\SkinColor
    local SkinColor = Instance.new("IntValue", Data)
    SkinColor.Name = "SkinColor"
    SkinColor.Value = 0
    --\\Shirt
    local Shirt = Instance.new("IntValue", Data)
    Shirt.Name = "Shirt"
    Shirt.Value = 1
    --\\Pants
    local Pants = Instance.new("IntValue", Data)
    Pants.Name = "Pants"
    Pants.Value = 1
    --\\Quirk
    local Quirk = Instance.new("IntValue", Data)
    Quirk.Name = "Quirk"
    Quirk.Value = 0
    --\\Has Quirk
    local HasQuirk = Instance.new("BoolValue", Data)
    HasQuirk.Name = "HasQuirk"
    HasQuirk.Value = false
    --\\Affiliation
    local Affiliation = Instance.new("IntValue", Data)
    Affiliation.Name = "Affiliation"
    Affiliation.Value = 0
    --\\Occupation
    local Occupation = Instance.new("IntValue", Data)
    Occupation.Name = "Occupation"
    Occupation.Value = 0
    --\\Yen
    local Yen = Instance.new("IntValue", Data)
    Yen.Name = "Yen"
    Yen.Value = 0
    --Quests
    local QuestValue = Instance.new("IntValue", Data)
    QuestValue.Name = "Quests"
    QuestValue.Value = 0
    --\\Fame 
    local Fame = Instance.new("IntValue", Data)
    Fame.Name = "Fame"
    Fame.Value = 0
    --\\Fighting Style
    local FightingStyle = Instance.new("IntValue", Data)
    FightingStyle.Name = "FightingStyle"
    FightingStyle.Value = 1

    StrengthEXP.Changed:connect(function() XPChange(Player,StrengthEXP,Strength) end)
    AgilityEXP.Changed:connect(function() XPChange2(Player,AgilityEXP,Agility) end)
    MasteryEXP.Changed:connect(function() XPChange3(Player,MasteryEXP,Mastery) end)
    RageEXP.Changed:connect(function() XPChange4(Player,RageEXP,Rage) end)
end)

function XPChange(Player,StrengthEXP,Strength)
    if StrengthEXP.Value >= Strength.Value*150  then
        StrengthEXP.Value = 0 
        Strength.Value = Strength.Value+ 1
        Player.Character.Humanoid.MaxHealth = Player.Character.Humanoid.MaxHealth+1
    end
end

function XPChange2(Player,AgilityEXP,Agility)
    if AgilityEXP.Value >= Agility.Value*150 then
        AgilityEXP.Value = 0
        Agility.Value = Agility.Value+1
    end
end

function XPChange3(Player,MasteryEXP,Mastery)
    if MasteryEXP.Value >= Mastery.Value*150 then
        MasteryEXP.Value = 0
        Mastery.Value = Mastery.Value+1
    end
end

function XPChange4(Player,RageEXP,Rage)
    if RageEXP.Value >= Rage.Value*150 then
        RageEXP.Value = 0
        Rage.Value = Rage.Value+1
    end
end

TWEEN SCRIPT:

while true do
    wait()

    local XP = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Data.StrengthEXP.Value
    local MaxXP = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Data.Strength.Value*150

    local math = ( XP / MaxXP )

    script.Parent:TweenSize(UDim2.new(math,0,1,0),"Out","Quad",.25)
end

Answer this question