Hello, I'm trying to make a character customization and I have a problem, I want to make the player not move when the GUI is displayed and can move if the GUI is not displayed.
I tried this:
local plr = game.Players.LocalPlayer
local char = plr.Character
while script.Parent.Parent == plr.PlayerGui do
char:FindFirstChild("UpperTorso").Anchored = true
end
while not script.Parent.Parent == plr.PlayerGui do
char:FindFirstChild("UpperTorso").Anchored = false
end
And this:
local plr = game.Players.LocalPlayer
local plrname = game.Players.LocalPlayer.Name
local char = game.Workspace:FindFirstChild(plrname)
while script.Parent.Parent == plr.PlayerGui do
char:FindFirstChild("UpperTorso").Anchored = true
end
while not script.Parent.Parent == plr.PlayerGui do
char:FindFirstChild("UpperTorso").Anchored = false
end
Nothing worked, By the way I tried doing if ... then, Except of the while ... do and I'm using it in a LocalScript
Thanks, MajinBluee

9 comments
Yay now this title is specific
Is that in script or local script?
Does your game force R15 or is it Player's Choice? Because if it IS Player's Choice then you would have to do both "UpperTorso" (R15) and "Torso" (R6).
I said i'm using it in a script and it's forced to be R15
Oh, okay.
Then try anchoring the HumanoidRootPart instead of the UpperTorso and see what happens.
Still doesn't work
What's script.Parent.Parent referring to?
The Gui's Parent