Help needed with automaticly spawning bear

Hello Robloxians, I have a problem with defining a position of a model in a folder that’s parented to serverstorage.
image
I want to do Bear.position but it does not show the position command.
Does anybody know why or how i can spawn bear?

1 Like

Is the bear a model or a part?

2 Likes

the bear is a model.

1 Like

Ohh lemme send the script real fast

1 Like

use Instace:PivotTo(CFrame)

bear:PivotTo(game.Workspace.YourPosition.CFrame)

i forgot to tell you guys i would like to have the position randomized

1 Like

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()
1 Like

Ohh okay!!

[ignore this → hfbkerhdnsfngrds]

1 Like
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.

1 Like
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()
1 Like

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()
2 Likes

do you know how to make it so the bear randomizes around the whole baseplate?
the baseplate size = 2048, 16, 2048

1 Like
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


1 Like

first, you stole my script second, he never said the whole baseplate.

1 Like

If the baseplate’s size is 2048, you would go to the extents of -1024 to 1024.

1 Like

uhhh why are you so angry?
i just asked if you know how to make it so it spawn around the whole baseplate.

1 Like

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?

1 Like

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.

1 Like