Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come this only anchors the player in studio but not in game?

function die()
script.Parent.Parent.Parent.ShopFrame.Visible = false
script.Parent.Parent.Parent.Frame.TextLabel.Visible = true
local player = game.Players.LocalPlayer
player.Character.Torso.Anchored = true
end

script.Parent.MouseButton1Down:connect(die)

What it does is it makes the other guis not to be shown and is supposed to anchor the player when in shop.

2 comments

0

Try changing your script into a localscript (if it isn't one already)

0

It's might be because you need to 'repeat wait() until player.Character'? Sometimes roblox stuffs up with this stuff

2 answers

Change the player.Character.Torso.Anchored = false to player.Character.Torso.Anchored = true .

Hope this helps.

1 comment

0

i did

function die()
script.Parent.Parent.Parent.ShopFrame.Visible = false
script.Parent.Parent.Parent.Frame.TextLabel.Visible = true
player = game.Players.Name
	for i,v in pairs(game.Players.Name) --Get players name in a loop
		player.Character.Torso.Anchored = false

script.Parent.MouseButton1Down:connect(die)

2 comments

0

Wait does this anchor every player?

0

Should not

This discussion is preserved as it was. New answers, comments, and votes are closed.