i need help getting the values for the moods right now its printing nil
local Moods = require(game:GetService("ReplicatedStorage").Data:WaitForChild("ReturnMoods"))
local Player = game.Players.LocalPlayer
local MoodBar = script.Parent.MainFrame.FunMoodFrame.Bar
local MoodTitle = script.Parent.MainFrame.FunMoodFrame.Bar.TextLabel
local function DecreaseMoodBar(moodValue)
if moodValue == nil then moodValue = 0 end
local maxHeight = MoodBar.AbsoluteSize.X
local targetHeight = maxHeight * (moodValue / 100)
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local goal = {}
goal.Size = UDim2.new(0, MoodBar.AbsoluteSize.Y, 0, targetHeight)
local tween = game:GetService("TweenService"):Create(MoodBar, tweenInfo, goal)
tween:Play()
MoodTitle.Text = tostring(moodValue) .. "%"
end
local funMood = Moods.GetMood(Player, 'Fun')
DecreaseMoodBar(funMood)
print(funMood)
this is the local script that should be tweening the value and changing the text based on the mood value.
local module = {}
module.Profiles = {}
function module.UpdateMood(player, Mood)
local profile = module.Profiles[player]
if not profile then return end
profile.Data.Moods.Fun += Mood
player.Moods.Fun.Value = profile.Data.Moods.Fun
end
return module
this is the module that returns the value of the specified mood in the local script
local module = {
Money = 0,
Moods = {
Fun = 100,
Energy = 100,
Hunger = 100,
Hygiene = 100
}
}
return module