|
| 21 Jan 2014 05:37 PM |
I am trying to whip up another script, and I came across an problem... should it be script.Parent.Workspace... or script.Workspace? the script itself is in Workspace so im in a bit of confusion...the script also seems to not work, am I not doing something right here?
Word = "start"
flap = script.Workspace.Pads:GetChildren()
game.Players.PlayerAdded:connect(function(player) Players.Chatted:connect(function(msg) if (msg == Word) then while true do wait() for i = 1, #flap do if (flap[i].className == "Part") then flap[i].CFrame = flap[i].CFrame + Vector3.new(0.1,0,0) end end
end end end) end) |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2014 05:38 PM |
workspace alone:
workspace.Pads:children() |
|
|
| Report Abuse |
|
|
| |
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 21 Jan 2014 05:40 PM |
You don't seem to understand the hierarchy of the roblox file tree.
At the top of everything is game, or Game. Under game are all the services, which are Workspace, Lighting, ReplicatedStorage, Teams, etc...
Inside a script, you can refer to workspace as game.Workspace or just workspace.
Dot notation is used to follow a path of objects: script.Workspace makes no sense, because Workspace is not a child (descendent) of script.
If the script is in the workspace, then you can use "script.Parent" to refer to the workspace, or you can just use game.Workspace, or workspace, as mentioned above.
Let me know if you have any further questions. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2014 05:43 PM |
| i do get it, but im not that knowledgable for scripting yet... thats why im going to college for it next year, so i can learn even more of the properties and the ins/outs of it since the ROBLOX wiki doesnt really do it well |
|
|
| Report Abuse |
|
|
duckwit
|
  |
| Joined: 08 Aug 2008 |
| Total Posts: 1310 |
|
|
| 21 Jan 2014 05:45 PM |
| I started learning a month or so ago, the Roblox Wiki tells me practically everything about scripting in Roblox. Give it some time and patience, it'll begin to sink in. |
|
|
| Report Abuse |
|
|