Module script:
local guns = {}
guns.list = {
"AKM",
"M79"
}
guns.currentGun = "AKM"
return guns
Script changing the module script: (local script)
local uis = game:GetService("UserInputService")
local rs = game.ReplicatedStorage
local guns = require(rs.Guns)
uis.InputBegan:Connect(function(input,process)
if not process then
if input.KeyCode == "1" then
guns.currentGun = guns.list[1]
print("changed current gun to "..guns.currentGun)
end
if input.KeyCode == "2" then
guns.currentGun = guns.list[2]
print("changed current gun to "..guns.currentGun)
end
end
end)
This doesn’t work, but is there a way to fix it, or is there a different way to change info in a module script? I’m trying to change the current gun.