#What am I doing wrong?
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
what is the purpose of "glowberry"
It doesn't really have a purpose I've just started the creation of the game. I just want to figure out how to make a copy of glowberry that will have a chance to appear on spawn every now and again before I develop it further
sorta like a random spawn?
only one spawn point?
I'll add more later, but for now Im just trying it with this one spawn point
I can always just duplicate spawn and have it in several places around the map
If you can, that would be PERFECT
any specific spawn interval?
I'm confused why it's not that simple though, wouldnt each spawn have a chance at duplicating glowberry and having it spawn?
Not really because I can change it when necessary
well, it might just spawn on all the spawns at once then
Ah that makes sense actually
what i did is i made two spawns, "glowberryspawn1" and "glowberryspawn2" so it spawns randomly between the two and only onone of them
Oh cool!
just testing
If I were to add more glowberry spawns later on is that possible?
yes i will show you how in a second
do you want the glowberry to get destroyed when it respawns on another spawn? or just them to pile up
Id like to have them able to spawn at the same time, but not all the time
If you get me
i dont understand lol
Let me think of how to explain this
Each spawn has its own chance to spawn the glowberry for 5 minutes at a time, so multiple could spawn but none might spawn
im saying after it spawns on another spawnpad must it stay on both spawns or get destroyed on the original spawn
Nope, thanks for clarifying, id like them to spawn on a pad, exist for 5 minutes, and then disappear
gotcha
So every 5 minutes 1 pad could spawn one, or none, or all of them
I hope that's a little clearer sorry
for the sake of time im just going to make it a couple of seconds but you can change it later
Yeah ofc that's fine, I was trying to do that anyways haha
** You are now Level 2! **
im just adding some comments to help
You're honestly brilliant thank you so much
--Put this script into ServerScriptService.
--Make three parts each called GlowberrySpawn1, GlowberrySpawn2, GlowberrySpawn3.
--Make a part named "Glowberry" and put it into ReplicatedStorage, the part will dissapear its normal.
--Anchor all parts so they dont roll around on the map
local replicatedStorage = game:GetService("ReplicatedStorage")
local glowberryTemplate = replicatedStorage:WaitForChild("Glowberry")
local spawnPoints = {
workspace:WaitForChild("GlowberrySpawn1"),
workspace:WaitForChild("GlowberrySpawn2"),
workspace:WaitForChild("GlowberrySpawn3")
}
local spawnInterval = 12 -- Time between spawns (SECONDS)
local activeGlowberries = {} -- Track current glowberries
-- Chance to spawn at a given point (between 0 and 1), 0=none 1=always
local spawnChance = 0.5 -- 50% chance
-- Function to spawn a glowberry at a specific spawn point
local function trySpawnGlowberry(spawnPart)
if math.random() < spawnChance then
local glowberry = glowberryTemplate:Clone()
glowberry.CFrame = spawnPart.CFrame
glowberry.Parent = workspace
table.insert(activeGlowberries, glowberry)
-- Destroy it after 5 seconds (deletes after 5 seconds)
task.delay(5, function()
if glowberry and glowberry.Parent then
glowberry:Destroy()
end
end)
end
end
-- Main loop (DONT CHANGE OR IT WILL BREAK)
while true do
wait(spawnInterval)
-- Clear previous references
activeGlowberries = {}
-- Try spawning at each spawn point
for _, spawn in pairs(spawnPoints) do
trySpawnGlowberry(spawn)
end
end
there will be a little copy button when you hover over it
just click that and wabam!
roblox studio on mobile?
just use discord on your browser
Oh you can do that?
you have to copy it
The app made my laptop practically take off like a helicopter
Alrighty, thanks a bunch
let me know if you need any help
Is it okay if I keep you in my dms?