#Script that clones a part with specific attributes to the end of a part.
1 messages · Page 1 of 1 (latest)
to generate parts infinitly you do just use
local newpart = part:clone()
say you store the original part in replicatedstorage you will need to parent it to the workspace and position it how you see fit
but clone() allows for limitless replication
ahh i get you
local RunService = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local root = character:WaitForChild("HumanoidRootPart")
--// create part
local part = Instance.new("Part")
part.Size = Vector3.new(6, 1, 6)
part.Anchored = true
part.CanCollide = true
part.BrickColor = BrickColor.new("Bright red")
part.Parent = workspace
--// define a fixed Y level for the player to walk on
local fixedY = 3
RunService.Heartbeat:Connect(function()
if root then
--// position the block under the player at the fixed Y level
local pos = root.Position
part.Position = Vector3.new(pos.X, fixedY, pos.Z)
end
end)
no matter where i walk it will "follow" underneath me
of course this means that they cant teleport under the Y level
or above or they will just fall
so if thats a deal breaker you could quickly calculate the Y level based on their position
And so where will I put this script?
And like how do I make it
If you just cant tp the part with the y level then its ok
Like where should I put the script and should I use a local script or a regular
I got it
as a fun little gratitude
Please watch this @carmine axle
This would only work client-side, btw
I just put it into StarterPlayer - StarterCharacterScripts
and it worked flawlessly
I'm kinda making this game only for me. not really for public
yes it wont replicate to other clients though
wdym
if another player joined they wont see any of the parts
I don't want the player to be able to see the part
I want to make an "endless" baseplate and they can "walk" on the baseplate
Im gonna make a quick video for you
I mean I guess it fits your purpose but in terms of replication maybe not the best
alright, if you are just making a game for you this would work but for later reflection about replication I will show you two images
this is what the client sees
this is what the server sees
I changed the sript
script*
to make on y level -1
and that way it looks like I'm walking on the floor
but for some reason after a while the floor dissapears
I used a special mesh to make it "infinite"
but I really wanna make it infinite
u got anythin for that?
Like I wanna make infinite terrain but idk how.
like natural terrain generation?
Idk man
I want a part to be able to "stretch" infinitely
I have a main baseplate that I want to be able to be an infinite size
but idk how without it breaking
I mean you could increase the size when the player gets near the edge but it would be obvious to the player that you are doing that
still
but how do I do it to make it seem like terrain generation but with just a regular part
could you explain a little deeper for what exactly you are looking for?
I want to make a game about the roblox's glitching zones like the null zone when you go too far out
and it starts glithcing the hell out
While the natural generation of terrain is very complicated, you could use math.noise()
explain.
you know minecraft?
ye
the terrain is generated with a thing called Perlin noise and roblox also has perlin noise which is math.noise()
It basically gives you random values that are kinda in some sort of pattern
the hardest part with an infinite map is storing all that in ram
if you did anything relating to map generation you would have to make something that deletes and stores terrain to a table when the player gets too far
or else it isnt going to be infinite because the players game will crash when they walk too far
i dont think he minds lol i think he just wants players to traverse through the space in the experience how they see fit
yeah I figured I was more just talking about replication lol
well alr but how do I do this math.noise() stuff?
i dont think terrain gen is required for this
Well then how do I make an infinite map without the players game crashing
just spawning a really large part under the player should allow them to go wherever they want
cuz I don't want the player to crash
I just put it out there because he was talking about "terrain"
so I should just make the part big?
then you need a service like heartbeat
spawn a big part under them
clean the part up when no longer used
it would cost very little performance
wait im gonna test something real quick
the script i sent just repositions the same part at your feet
so its not hurting performance
I made the part be the max size
and it kinda looks like the player is walking on a big map but not really
imma do a quick vid
This what i got to do
i believe this script does what you want, just make it so players can only change the x and z for teleport
the y level doesnt need to change
for the part
unless the playe will be just stuck in the air
which isnt all that bad
exactly so make it so they get X and Z to change only
make Y always 10
and they can teleport anywhere and this script will always have a part under them
it will
keep in mind a certain distance you will die or the game breaks
I made a textlabel for the player that the middle coordinate has to be atleast 100 so they don't fall through
here
** You are now Level 10! **
but again I want to be able to make the map almost infinite
yep perfect
im not sure you can do that 🤔
Like not even with script?
That when a part gets touched the baseplate changes size?
LIke the max is like 2048 or something i think
oh you just mean the parts size?
This is what I use to teleport
I use these coordinates without the commas and the thing works
why do you want to override the part 2048 size? it doesnt stop you in this instance does it
wdym
Like I cant change the part to 1b studs
the max is like 2028
in x y z
and you cant go over that no matter how hard i try
I can use specialmeshes but after a while they dissapear
and the textures break if I set them to like 1000
And I wanna be able to override the max part size to "infinite"
without the players game crashing of course
im not sure why you want that for your project though you could have the part 5,5 and the player can still teleport anywhere
the only way to overide the size is with multiple parts
so you would have to tile the parts layer by layer but players wouldnt even be able to see nor get to those parts anyway
well rip
still it will only be available for me for now
btw
anyway I can make a gif into roblox
Say like this
this is a gif but for here it isnt
but I want to be able to use a gif as an animation
anway i can do that?
this
bro..
this
I want to be able to use this in roblox but idk how
you got anything to help me @carmine axle?
no idea maybe try #🧊︱modeling channel
well alr