I am trying to make it so if a certain player touches another player, the touched player will run a pathfinding script and walk there. what I've done is I will fire all clients and from a local script, it will check if the given name matches localplayer's name and if so, it will make the player go to a part inside of workspace. Everything works except the pathfinding service, which has an error:
Unable to cast to Dictionary
In the following picture you can see that, on line 1, it returns the correct name.
I did borrow this code from another post and modify it.
Script:
local plr = workspace[p.Parent.Name]
local player = game.Players:GetPlayerFromCharacter(plr)
local tagged = p.Parent.Name
print("tagger tagged "..tagged) -- this works as intentioned
game.ReplicatedStorage.RE.was_tagged:FireAllClients(p,tagged)
LocalScript:
function wasTagged(p,tagged)
if tagged == game.Players.LocalPlayer.Name then
print("Player reconized as the player who has gotten tagged ("..tagged..")") -- -- this works as intentioned
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Controls = PlayerModule:GetControls()
Controls:Disable()
local Pathfinding = game:GetService("PathfindingService")
local nodes = {
game.Workspace[tagged].Torso,
game.Workspace.CurrentMap.Map.taggedPoint,
}
local path = Pathfinding:CreatePath(nodes[1], nodes[2], 500) -- this is what is mentioned in the error
if path.Status == Enum.PathStatus.Success then
local humanoid = game.Workspace[tagged].Humanoid
local points = path:GetPointCoordinates()
for _, point in ipairs (points) do
humanoid:MoveTo(point)
repeat
local distance = (point - humanoid.Torso.Position).magnitude
wait()
until distance <= 3
end
else
warn("Path creation unsuccessful")
end
end
end
game.ReplicatedStorage.RE.was_tagged.OnClientEvent:Connect(wasTagged)

5 comments
You're not using CreatePath() correctly and :GetPointCoordinates() is deprecated.
what do I use...? roblox wiki makes so sense
It's been replaced with :GetWaypoints(). The main problem is line 12 which needs an int value. You're indexing objects there. I don't want to ghost anyone on this since I'm not on my computer. This deserves a good explanation.
Just wondering if anyone has an alternative to the roblox wiki because as Superman said, it makes no sense sometimes, does anyone have a better source of information?
the answer: no. YouTube is a pile of steaming buffalo crap and the Roblox Wiki is your one reliable source for something like this.