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

local script working in studio mode but not play?

cant find the problem :|

local choose = script.Parent.Choose
local a = game.Lighting.Choices:FindFirstChild(choose.Spin.TextLabel.Text)
	a:Clone().Parent = script.Parent.Parent.Parent.Backpack
	a:Clone().Parent = script.Parent.Parent.Parent.StarterGear

1 comment

0

Is this a Script or a LocalScript?

1 answer

✓ Accepted answer

I'm guessing the problem is that the script is running before everything is loaded (you can check by looking at the developer console by pressing F9 in online mode: if you find an error that says something like "attempt to index [variable name here] (a nil value)" , that could be it) Try using "WaitForChild" commands instead of accessing children directly. ex:

local choose = script.Parent:WaitForChild("Choose")

If that's not the problem, having the error message from the developer console would help greatly.

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