#Map Randomizer
32 messages · Page 1 of 1 (latest)
** You are now Level 1! **
Hi! suggestion, instead of taking it back into the workspace
just clone it
and destroy the clone when you finish with it
less overhead
annd your code is quite overcomplicated, the if statements might be the thing messing with it
but you can just do
local MapsArray = rep.Maps:GetChildren()
local ChosenMap = nil
InRound.Changed:Connect(function(inRound)
if inRound then
ChosenMap = MapsArray[math.random(1, #MapsArray)]:Clone()
ChosenMap.Parent = workspace
else not inRound and ChosenMap ~= nil then
ChosenMap:Destroy()
end
end)
that's about it
no need to overcomplicate mate
Didn’t work /: although I don’t think it has anything to do with the scripting
show output
“Attempt to index boolean with ‘changed’”
What are u using for inround
A bool value
So that’s the problem
I just don’t know how else to do it i cant use .changed with a bool value
ofc if you copy pasted this and did absolutely nothing else it will not work 🙂
because it's not changed
it's Changed
capital c
Yeah ik i didnt completely copy paste it
Ok got it to work apparently you don’t have to add .value when referencing the bool value no idea why but it works thanks!
oh easy
here
Follow me on:
Twitter: https://twitter.com/iced_coffee_dev
Github: https://github.com/simondevyoutube/
This video covers pass by value vs pass by reference in JavaScript, an important and fundamental concept in computer science. We'll be doing a deep dive, covering how memory allocation of variables works, how function argument passing is done,...
this applies to all programming languages btw
not just roblox
you are basically a value not the object value value 🙂