Is it possible to change a Module script with a script or local script?

So i’m trying to make a Semi-trailer attatchment for trucks but the thing is i’m stuck with an module script that i need to change with a different script but i don’t know how…

local UserValues = {}

UserValues.UsesClickToConnect = false
UserValues.WhitelistIds = {1115747243}
UserValues.HitchName = "Coupler"

return UserValues

So as you can see in that script it says “UserValues?WhitelistIds” but i don’t know the users id (its a game with truck spawn system etc).

2 Likes

You can just do this with any value and edit it.

local Module = require(modulelocationhere)
Module.WhitelistIds = things here
5 Likes

So at the things here you mean then the script for example button touched?

You can edit module scripts in a local script or server script. Just change the values to whatever you want.

Well i tried but it just won’t work… its inside a gui button…
Code i’m using:

script.Parent.MouseButton1Click:Connect(function()
	local Player = game.Players.LocalPlayer
	local UserID = Player.UserId
	local Module = require(game.Workspace.IDontKnowAUserNamzsCar.Body.FifthWheelHitch.Hitch.UserValues)
	Module.WhitelistIds = {UserID}
end)

print module.whitelistids. See what it prints. Also is this a local script or server script. Are there any errors in the output?

Its a local script and there anen’t any errors

well print it and see what it prints.

1 Like

It printed my UserId So i’m sure it worked! Thanks for the help!!

1 Like

Do you mind marking this post as the solution since it worked?

2 Likes