Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a Model :Clone() but only on a random position of a Baseplate?

Asked by 3 years ago

Okay so I am currently working on a sword fighting game and there are these Orbs that clone around the map, Called "Timepart12" from ReplicatedStorage.

When you touch them, you get 20 "Time" as a leaderstat.

Sometimes when players walk into them, they get more than that because they sometimes spawn inside of each other, as this script doesn't put them at a specific position.

while true do wait(math.random(30,90)) game.Lighting.Timepart12:Clone().Parent = game.Workspace wait(10) end

so I want to still use a while true do, and make these '"Timepart12"'s :Clone in a random position within a Base plate that is 272, 13, 272 in size.

I am really new to this whole scripting thing so maybe you can provide me with some information inside of the script like what to change.

I would appreciate it! Thank You!

0
by randomly clone, I mean (X,Z) not vertically Julien999111 0 — 3y
0
use vector3 with each parameter being math.random with the max being 272 and y being 13 kepiblop 124 — 3y
0
can you put that in a script for me im dumb :/ Julien999111 0 — 3y
0
hey Julien999111 0 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago
while true do 
    wait(math.random(30,90)) 
    local timePart = game.Lighting.Timepart12:Clone()
    timePart.Parent = game.Workspace wait(10) 
    timePart.Position = Vector3.new(math.random(-100, 100), 5, math.random(-100, 100))
-- change -100 and 100 (get x pos of both corners on x side of baseplate) and do same for z
end
0
You can get position from placing a part at the corners, also move the y up or down if you want  BulletproofVast 1033 — 3y
0
thank you it works! Julien999111 0 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

thanks!

Answer this question