Hi there, I am trying to make a command where it can open and close the self check in for a specific class. I’ve tried everything but it doesn’t seem to change the boolvalue to true.
permission = {"UOME2K"}--Please keep my username is tere, :D
function check(player)
if table.maxn(permission)==0 then return true end
for i = 1,#permission do
if string.lower(player.Name)==string.lower(permission[i]) then return true end
end
return false
end
local ecoboolvalue = game.Workspace.StarterGUI.SCI.SelfCheckInFrame.ecoInfo:FindFirstChild("EcoDecision")
if msg:lower() == "!openeconomy" then
ecoboolvalue = true
elseif msg:lower() == "!closeeconomy" then
ecoboolvalue = false
-- If value of 'testBoolean' is false, this condition is executed
end
No matter how much I try, I can’t seem to change it’s boolvalue. I’m not entirely sure but I think the location of my boolvalue I entered is incorrect.
You need .Value to change the value of the instance
if msg:lower() == "!openeconomy" then
ecoboolvalue.Value = true
elseif msg:lower() == "!closeeconomy" then
ecoboolvalue.Value = false
-- If value of 'testBoolean' is false, this condition is executed
end
hmm, what is the player variable, i was assuming it was the player instance
edit: about the player gui thing,
When a Players’character respawns, the contents of their PlayerGui is emptied. Children of the StarterGui are then copied (along with their descendants) into the PlayerGui .
GUI objects such as ScreenGuis with their ResetOnSpawn property set to false will only be placed into each Player’sPlayerGui once and will not be deleted when the Player respawns.
the reason i was attempting to get the playergui was “The main storage object for 2D GuiObject displayed on the player’s screen. ScreenGuis will only be shown if parented to a player’s PlayerGui .”
also could you attempt to show me the explorer showing the path to the boolvalue, also is it a boolvalue or something else
edit: startergui replicats everything in itself and there desendants into playergui whenever the player dies/ joins