So I've used the string match off the wiki to find the name of the player in a string and if it finds it then it makes part of the UI non visible. I've printed out the string and it gives me the list of players (The _G.group2members one)
But for some reason, match is not making the UI non visible for those certain players.
Any help would be appreciated! Thanks.
if _G.group2members.match(player, "p%w+") then script.Parent.Template1.Add.Visible = false; end
Whatever you are doing is completely confusing, and is not valid. Here is some code (this is what I think you are trying to do):
local player = game.Players.LocalPlayer if string.match(_G.group2members,"//" ..player.Name.. "//") then -- if the player exists script.Parent.Template1.Add.Visible = false end
Make sure to separate all player names with symbol(s) or something else (e.g, //
) so that you can find them accurately.
This code would only work in a LocalScript
, because of LocalPlayer
, but you could swap that out script.Parent.Parent.Parent ...
until you get to the player.
Hope I helped!
~TDP
Not sure if this will help, but try making line 2 this.
script.Parent.Template1.Visible = false
or try this
script.Parent.Template1.Add.Visible = false