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

why my variable cant be read by the script?

im familiar with variable but today i just faced something new

print("Start")
	aaa1 = game.Workspace.Defend.Value
	aaa2 = game.Workspace.Prosecutor.Value
	game.Workspace.aaa1.HumanoidRootPart.CFrame = game.Workspace.Defendantdesk.tp.CFrame
	game.Workspace.aaa1.Torso.Anchored = true

instead of reading the variable the studio is searching for aaa1. how to make the studio read aaa1 is equal to game.Workspace.Defend.Value?

1 answer

✓ Accepted answer

Use FindFirstChild() without the quotation marks.

game.WorkSpace:FindFirstChild(aa1).HumanoidRootpart.CFrame

Also unless you need to use a global variable, you should use a local variable.

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