So, i have a script that's inside StarterPlayerScript that creates folders inside WORKSPACE. (LocalScript)
All of my scripts are able to reach a folder that's created when a player joins. The foldername is PlayerInfo.
However, i'm scripting another script that's going to be in a model in WORKSPACE, that has to reach PlayerInfo.
The following script has to reach it: (normale script, also tried Local)
wait() PlayerInfo = workspace.PlayerInfo wait() while true do wait() if workspace.PlayerInfo.Mode == "Medium" then script.Parent.Slow:Destroy() script:Destroy() print("Slow Destroyed") elseif workspace.PlayerInfo.Mode == "Slow" or "Hard" then script.Parent.Medium:Destroy() script:Destroy() print("Medium Destroyed") end end
The script only will be enabled if PLAYERINFO EXCIST!
And yes, the script will be enabled. So, PlayerInfo does excist. I've checked in play-mode, and it excist.
HOWEVER<
The script above gives me this freaking error:
PlayerInfo is not a valid member of Workspace
like, wtf. Every script that i wrote says it's here. But this cunt won't find it?
I've tried :WaitForChild, :FindFirstChild and so on.
All keep saying it does not excist! WHILE IT EXCIST!
Anyone who can help me. This is driving me crazy!
try this before the line if workspace.PlayerInfo.Mode == "Medium" then insert if workspace:FindFirstChild("PlayerInfo") then and put an extra end, this will check if playerinfo exists and then do the next lineso the code should look like this
while true do wait() if workspace:FindFirstChild("PlayerInfo") then if workspace.PlayerInfo.Mode == "Medium" then script.Parent.Slow:Destroy() script:Destroy() print("Slow Destroyed") elseif workspace.PlayerInfo.Mode == "Slow" or "Hard" then script.Parent.Medium:Destroy() script:Destroy() print("Medium Destroyed") end end end
COOL! SO I DECIDED TO MOVE PLAYERINFO TO BACKPACK...
Same stuff. Backpack is not a valid member of Player...
local player = game.Players.LocalPlayer ReadyFolder = Instance.new("Folder") ReadyFolder.Parent = player.Backpack ReadyFolder.Name = "PlayerInfo"