I am trying to make a part that has a 50% chance of spawning a wood on it's position, but when I copy more of the blocks and start the game it just spawns on all of them or on none, no erros, and I have no idea how would I fix it
The block is just a half transparent part with a single script in it, the wood is in replicatedstorage
math.randomseed(tick())
local random = math.random(1,400)
if random > 1 and random < 200 then
local wud = game.ReplicatedStorage.Wood:Clone()
wud.Parent = game.Workspace
wud:MoveTo(script.Parent.Position)
elseif random > 200 and random < 400 then
print("nothing")
end
script.Parent:Destroy()

6 comments
i think u should put a space after math.randomseed and math.random
Like this ? "math.random (1,400)" instead of this ? "math.random(1,400)"
If yes that didn't make any difference
Correct me if im wrong but math.random(1,2) is a 50/50 chance.. you have 50% chance to get either 1 or 2 so why wont you just do that instead? If its 1 then spawn a wood and if its not 1 you dont even need to specify anything else.. it doesnt know what to do when its 2 so it wont do anything so no need for that print("nothing")
Okay, I will try that
Nope, still does the same, I copy and paste the parts like 20 of them, once they all spawn wood and once nothing