sk8er551Join Date: 2010-03-22 Post Count: 26 |
while true do
path = Game:GetService("PathfindingService"):ComputeRawPathAsync(game.Workspace.Start.Position, game.Workspace.Finish.Position, 200)
points = path:GetPointCoordinates()
game.Workspace.points:ClearAllChildren()
for p = 1, #points do
part = Instance.new("Part")
part.FormFactor = Enum.FormFactor.Symmetric
part.Size = Vector3.new(1,1,1)
part.CanCollide = false
part.Position = points(p)
part.Anchored = true
part.BrickColor = BrickColor.DarkGray()
part.Parent = game.Workspace.Points
end
wait(.1)
end
Just trying to make some bricks between Start and Finish, but I keep getting "part is not a valid member of Workspace"
What am I doing wrong here?
P.S. don't expect me to know anything |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
speed bump |
|
chimmihcJoin Date: 2014-09-01 Post Count: 17143 |
That error is not coming from that code.
|
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Oh, well I feel stupid. Meant to say "points is not a valid member of Workspace." |
|
morashJoin Date: 2010-05-22 Post Count: 5834 |
Change "points" to "Points" |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
while true do
path = Game:GetService("PathfindingService"):ComputeRawPathAsync(game.Workspace.Start.Position, game.Workspace.Finish.Position, 500)
points = path:GetPointCoordinates()
game.Workspace.Points:ClearAllChildren()
for p = 1, #points do
part = Instance.new("Part")
part.FormFactor = Enum.FormFactor.Symmetric
part.Size = Vector3.new(1,1,1)
part.CanCollide = false
part.Position = points(p)
part.Anchored = true
part.BrickColor = BrickColor.DarkGray()
part.Parent = game.Workspace.Points
end
wait(.1)
end
Still nothing... |
|
morashJoin Date: 2010-05-22 Post Count: 5834 |
Any new errors or the same old one? |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Same, but now it's capitalized. |
|
morashJoin Date: 2010-05-22 Post Count: 5834 |
Check the name and location of the model you're trying to put the points into. |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
It seems fine, everything as intended. Still nothing.. |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Woah it's getting bumpy |
|
|
This Code should work..
while true do
path = Game:GetService("PathfindingService"):ComputeRawPathAsync(game.Workspace.Start.Position, game.Workspace.Finish.Position, 500)
pointStore = Instance.new('Model)
pointStore.Name = "Points"
if game.Workspace:FindFirstChild'Points' == nil then
pointsStore.Parent = game.Workspace
end
points = path:GetPointCoordinates()
game.Workspace.Points:ClearAllChildren()
for p = 1, #points do
part = Instance.new("Part")
part.FormFactor = Enum.FormFactor.Symmetric
part.Size = Vector3.new(1,1,1)
part.CanCollide = false
part.Position = points(p)
part.Anchored = true
part.BrickColor = BrickColor.DarkGray()
part.Parent = game.Workspace.Points
end
wait(.1)
end
|
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
No dice. But at least I'm getting a different error message this time: ServerScriptService.Script:6: attempt to index global 'pointsStore' (a nil value) |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Woops, turns out there was a typo there. But now I'm getting the old error again:
Workspace.Script:18: attempt to call global 'points' (a table value) |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
while true do
path = Game:GetService("PathfindingService"):ComputeRawPathAsync(game.Workspace.Start.Position, game.Workspace.Finish.Position, 500)
pointStore = Instance.new('Model')
pointStore.Name = "Points"
if game.Workspace:FindFirstChild'Points' == nil then
pointStore.Parent = game.Workspace
end
points = path:GetPointCoordinates()
game.Workspace.Points:ClearAllChildren()
for p = 1, #points do
part = Instance.new("Part")
part.FormFactor = Enum.FormFactor.Symmetric
part.Size = Vector3.new(1,1,1)
part.CanCollide = false
part.Position = points(p)
part.Anchored = true
part.BrickColor = BrickColor.DarkGray()
part.Parent = game.Workspace.Points
end
wait(.1)
end
Workspace.Script:18: attempt to call global 'points' (a table value)
Not sure why... |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Bump. I'm beginning to believe that I have a curse... |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Bump, once again. |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Yep, definitely cursed. |
|
|
belial52Join Date: 2009-10-10 Post Count: 8074 |
part.Position = points(p)
Change it to points[p] |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Cool, it worked! But now Roblox Studio is crashing every 5-10 seconds or so. Anyone know why this might be? |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Every 5-10 seconds after running the script, that is. |
|
|
Copied code from the PathfindingService tutorial on the ROBLOX YT channel.
choo choo |
|
sk8er551Join Date: 2010-03-22 Post Count: 26 |
Why yes, it was. All the more curious as to why it wouldn't work.. |
|
|
You obviously didn't copy it right.
._.
choo choo |
|