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

Workspace is not a valid member of Script.help?

this is the error i get on my script "Workspace is not a valid member of Script" this is my script

local players = game.Players:GetChildren() local maps = game.Lighting:GetChildren() local currentmap = game.Workspace:WaitForChild("CurrentMap") local chosenmap = script.Workspace:WaitForChild("ChosenMap") local spawner = game.Workspace:WaitForChild("Spawn") -- Change "Spawn" to your spawn name local choices = {}

why do i get this error can you fix it please this will save me

1 answer

✓ Accepted answer

It is most probably the fact that you did script.Workspace either do game.Workspace or workspace Your script should probably look like this

local players = game.Players:GetChildren() 
local maps = game.Lighting:GetChildren() 
local currentmap = game.Workspace:WaitForChild("CurrentMap") 
local chosenmap = game.Workspace:WaitForChild("ChosenMap") 
local spawner = game.Workspace:WaitForChild("Spawn") -- Change "Spawn" to your spawn name 
local choices = {}

These are the only errors I can see. If you could explain your script a bit more it would help me answer it more better :D

4 comments

0

thank you so much for your help i fixed that error with your help :D ....you made me happy I have been looking for hours for solution you helped :D ..now i have another error it says Infinite yield possible on 'Workspace:WaitForChild("ChosenMap")'....that would be amazing if you know what can i do for this one...my script is about teleporting players inside the game from lobby to the map..thanks

0

just do game.Workspace:WaitForChild("ChosenMap" , 50)

0

wow thank you so so much you are the best it worked :o i hope you have an amazing day....thanks so much for helping

0

np if you need any more help just message me or comment on this?

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