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

How to make parts unanchor for only the client that executed it?

I am making a game and you can unlock a character, but to unlock it you need to break some barriers, but I don't know how to make them break for only that one client but not the others that didn't do it. The code I were thinking of doing before I knew I had to do ClientSided was

local PartsToBreak = game.workspace.SecretCharacterLockedUpPlanks:GetChildren()
PartsToBreak.ClickDetector.Mouseclick:Connect(function()
	PartsToBreak.anchored = false
end)

I think it is something like that but I need it to be ClientSided instead of ServerSided.

1 answer

You gotta loop thought all parts like this:

local parts = game.Workspace.Folder:GetChildren()

for i,v in pairs(parts) do v.Anchored = false end

Make sure to put the LocalScript where it can be executed by the client (ex: startergui, starterplayer, etc)

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