Help, I'm trying to make a local infinite road (that the player can only see.) So I put this script in a local script, put it inside serverscriptservice and put the road I want to infinite inside the script. Nothing happens. There is no error. Why is this happening?

local RoadModel = script.Road


--for i = 1, 10 do
--	wait()
--	local Clone = RoadModel:Clone()
--	Clone:SetPrimaryPartCFrame(RoadModel.PrimaryPart.CFrame + Vector3.new(RoadModel.PrimaryPart.Size.X*i, 0, 0))
--	Clone.Parent = workspace
--end


local Index = 0
while wait(1) do
	Index += 1
	local Clone = RoadModel:Clone()
	Clone:SetPrimaryPartCFrame(RoadModel.PrimaryPart.CFrame + Vector3.new(RoadModel.PrimaryPart.Size.X*Index, 0, 0))
	Clone.Parent = workspace
end

3 comments

0

It works fine, are you trying to make it go the other way too or just faster?

0

Because you "put it inside serverscriptservice", local scripts do not run there, it's a server container, it says here all of containers where local scripts run: https://developer.roblox.com/en-us/api-reference/class/LocalScript; However the best one in your case is StarterPlayerScripts, also don't forget to use WaitForChild on the client.

0

that work