Hello Robloxians, I have a problem with defining a position of a model in a folder that’s parented to serverstorage.
I want to do Bear.position but it does not show the position command.
Does anybody know why or how i can spawn bear?
Is the bear a model or a part?
Ohh lemme send the script real fast
use Instace:PivotTo(CFrame)
bear:PivotTo(game.Workspace.YourPosition.CFrame)
i forgot to tell you guys i would like to have the position randomized
Use this
local AnimalFolder = game.ServerStorage.Animals
local bear: Model = AnimalFolder.Bear
local function CreateNewPart()
local NewBear = bear:Clone()
NewBear.Parent = workspace
local BearsPosition = Vector3.new(0,0,0) --CHANGE TO BEARS POSITION [ANY]
NewBear:PivotTo(CFrame.new(BearsPosition))
end
CreateNewPart()
Ohh okay!!
[ignore this → hfbkerhdnsfngrds]
local h = CFrame.new(math.random(-15, 15), 15, math.random(-15, 15)) -- X, Y, Z
bear:PivotTo(h)
i changed your code to have a math.random part and now the bear is just spawning at the place that if i put the bear in workspace it just keep spawning there.
local AnimalFolder = game.ServerStorage.Animals
local bear: Model = AnimalFolder.Bear
local function CreateNewPart()
local NewBear = bear:Clone()
NewBear.Parent = workspace
local BearsPosition = Vector3.new(math.random(2048, 16, 2048))
NewBear:PivotTo(CFrame.new(BearsPosition))
end
CreateNewPart()
Use this
local AnimalFolder = game.ServerStorage.Animals
local bear: Model = AnimalFolder.Bear
local function CreateNewPart()
local NewBear = bear:Clone()
NewBear.Parent = workspace
local BearsPosition = Vector3.new(math.random(-100,100),5,math.random(-100,100))
NewBear:PivotTo(CFrame.new(BearsPosition))
end
CreateNewPart()
do you know how to make it so the bear randomizes around the whole baseplate?
the baseplate size = 2048, 16, 2048
local AnimalFolder = game.ServerStorage.Animals
local bear = AnimalFolder.Bear
local destroyTime = 15
local waitDelay = 3
local function CreateNewPart()
local NewBear = bear:Clone()
NewBear.Parent = workspace
local newCFrame = CFrame.new(math.random(-2048, 2048), 18, math.random(-2048, 2048))
NewBear:PivotTo(newCFrame)
game.Debris:AddItem(NewBear, destroyTime)
end
while true do
CreateNewPart()
task.wait(3)
end
first, you stole my script second, he never said the whole baseplate.
If the baseplate’s size is 2048, you would go to the extents of -1024 to 1024.
uhhh why are you so angry?
i just asked if you know how to make it so it spawn around the whole baseplate.
Mein bad, thanks for correcting me out
If your here just to troll with all due respect please leave.
I just ask 1 time for help and you helped but then when i asked 1 more thing you just started feeling offended?
You could perhaps use math.Random((-game.Workspace.Baseplate.Size.X / 2), game.Workspace.Baseplate.Size.X / 2)) for the X axis, and math.Random((-game.Workspace.Baseplate.Size.Z / 2), game.Workspace.Baseplate.Size.Z / 2)) for the Z axis.