Module Script not saving values when edited

I am editing a module script value in a different module script called on serverinvoke

The edited value does not save. Ex: edited value = player.Name but all it prints is " " (the default value) in a local script

I have no clue what to do, I’m pretty sure that module script values can be changed, so I don’t know what’s wrong.

--Line that changes the val
require(newTower.Functions).Owner = player.Name

--Values inside the module:
towerFunctions.OriginalName = "Soldier"
towerFunctions.Owner = ""
towerFunctions.TargetMode = "Last"
towerFunctions.BoundarySize = 3
towerFunctions.Damage = 1
towerFunctions.Cooldown = 0.2
towerFunctions.Range = 12
towerFunctions.Level = 1
towerFunctions.Pierce = 0
towerFunctions.Price = 550
towerFunctions.TotalDamage = 0
towerFunctions.TotalPrice = 0
towerFunctions.TowerType = "Bullet"
towerFunctions.Upgrade = ReplicatedStorage.Towers.Upgrades:WaitForChild("Soldier [Lvl 2]") -- UPGRADETOWER
towerFunctions.UpgradeDescription = ""
towerFunctions.Debuff = {} -- TABLE OF DEBUFFS
towerFunctions.HiddenDetection = true
towerFunctions.FlyingDetection = true
towerFunctions.Image = nil
towerFunctions.LocalLimit = nil
towerFunctions.GlobalLimit = nil
1 Like

Refer to this. Basically, modifications to the module are only reflected in a single Lua environment. If your script is on the server, then only other server scripts can see the changes.

2 Likes

Oh okay, thanks! I didn’t know that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.