script1 path: game.StarterGui.AgilityValue.AgilityValueChange
local agility = script.Parent.Value local function onRunning(speed) game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Running:Connect(onRunning) if speed >0 then timeStarted = time() else local agilitygain = (time()-timeStarted) agility = (agility+agilitygain) agility = math.floor(agility) script.Parent.Value = (agility) end end
ok, so this script successfully changes the value of AgilityValue. But, in the other script i have,i am facing an issue.
script2 path: game.StarterGui.ScreenGui.Menu.MenuGUI.StatFrame.Agility.AgilityValueScript
local agility = game:GetService("StarterGui").AgilityValue.Value local agilityText = script.Parent.Text game.StarterGui.AgilityValue.Changed:Connect(function() agilityText = ("Agility:")..agility end)
Even though I am using the right path of agility, the agilityText remains as "Agility:" without showing the agility value next to it.
I would really appreciate it if someone helped me out, thanks :D
try changing
local agility = game:GetService("StarterGui").AgilityValue.Value
to
local agility = game:GetService("Players").LocalPlayer.PlayerGui.AgilityValue.Value
i think you need to access the value from inside the player