I was making kind of a GPS system, the server calculates a path, then returns the path. This uses a RemoteFunction. The server side code is correct, as the prints appear properly from the server side, but the client doesn't print a thing. I'm providing the LocalScript code below, since that seems to be the point of error. Sorry if I've made a silly mistake, pretty new to RemoteFunctions, since I don't really need them much. The Client's supposed to recieve the path from the server, then create parts.

local event = script.Parent.Parent.Parent.Parent.PlayerScripts local pointFolder = workspace.PointFolder local showing = script.Parent.Showing local replicatedStorage = game:GetService("ReplicatedStorage") local RFunction = replicatedStorage.RouteSystem.PointFunction

function invoke(path)
	local getPath = RFunction:InvokeServer()
	if path then
		local waypoints = path:GetWaypoints()
		print(path.Status)
		workspace.PointFolder:ClearAllChildren()
		print("Gonna enter the for loop")
	
		for i, v in pairs(waypoints) do
			local part = Instance.new("Part")
			part.Material = Enum.Material.Neon
			part.Size = Vector3.new(1, 1, 1)
			part.Position = v.Position
			part.Parent = pointFolder
			part.Anchored = true
			part.Name = "Part" .. i
			part.CanCollide = false
			part.BrickColor = BrickColor.new("New Yeller")
			if showing.Value == true then
				part.Transparency = 0
			end
			if showing.Value == false then
				part.Transparency = 1
			end
		end
	end
end

while true do
	if script.Parent.Showing.Value == true then
		invoke()
	end
	wait(5)
end

The small part the server returns and all

RFunction.OnServerInvoke = onInvoke

onInvoke's the function, and it returns "return path"

3 comments

0

try parenting the PointFolder to workspace.CurrentCamera and try it again. Clients can't access the workspace

0

Mhm. Gonna try it out. (Oh BTW the Client is only supposed to create parts for themselves to make it more clear.)

0

Nope, no luck. Probably some other error.