I'm new to programming and I am trying to change the screen GUI when another script activating,so here's what I am trying to accomplish.
I first coded a program for my character to dash, and what I imagine is when my character dash,it will change the size of the screen GUI. Here's the program of my dash.
local plr = game.Players.LocalPlayer
local Char = plr.Character
local UserInputService = game:GetService("UserInputService")
local ATapping= false
local ADcd = false
local module = require(game.StarterGui.ScreenGui["Energy(Back)"].EnergyBar.ModuleCostEnergy)
UserInputService.InputBegan:Connect(function(Input, Run)
if ADcd == false then
if Run then return end
if Input.KeyCode == Enum.KeyCode.A then
if not ATapping then
ATapping = true
wait(0.3)
ATapping = false
else
Char.HumanoidRootPart.Velocity = Char.HumanoidRootPart.CFrame.RightVector* -180
module.myFunc()
ADcd=true
wait(1)
print("A dash cd done")
ADcd = false
end
end
end
After that I also coded a module script and put it under the screen gui
local barsize = 100
local cost = 20
local module = {}
module.myFunc = function()
barsize = barsize - cost
print(barsize)
script.Parent:TweenSize(UDim2.new(barsize,0,0,26),"Out","Quint",0.25)
--test it the module works
print("testing if it works")
end
return module
And here's the problem,I put a print("testing if it works") and print(barsize) to see if the module script did run when the dash program activated and it does print out ,but it seems not affecting the screen gui,so what went wrong? is it because module script can not affect screen gui but local script can? If so how should I fix it? Thank you.

2 comments
I knew I was just making some dumb mistakes and I already spend around 2 hours trying to figure out, Thank you so much!
You're welcome! And don't worry, it happens... a lot