#Why is it when I trigger the proximityprompt, it changes the "stringMutationValue" value? [SOLVED]
1 messages · Page 1 of 1 (latest)
like this? also the issue is that it changes value without me even doing anything
but triggering a proximity
prox.Triggered:Connect(function(plr)
print(stringMutationValue.Value.." Line 416")
** You are now Level 1! **
I need more of the code that's inside the Triggered connection
Uh so all of this code has multiple places where it changes the value
I think I need more context
Horrific
stringMutationValue doesnt change tho
is it this?
Why is it when I trigger the proximityprompt, it changes the "stringMutationValue" value?
im basically asking why the stringMutationValue changes in 2 lines of code
** You are now Level 2! **
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
jeez sorry i asked, what a disaster
task.spawn(function()
while task.wait() do
local randomMythic=SodaTable[RNG:NextInteger(0, #SodaTable)]
for i, v in pairs(mutationTable) do
weight2-=mutationTable[i][2]
if chosen2>weight2 then
stringMutationValue.Value=mutationTable[i][1]
break
end
end```
it wasnt a problem before but its a problem now
there's yer problem 
doesnt the top one matter?
idk this code is really bad
i just do things the simple and complicated way man
ye this is the point where s1 beginner patterns fail
s1?
scripter ranking ;o
you share this instance value throughout your code and change it in all sorts of places for different reasons between yields and whatnot local stringMutationValue=sodamodel:WaitForChild("MutationValue")
it is bound to fail because of this
task.spawn(function()
while task.wait(3) do
chanceSystem()
end
end)```
beginner level patterns can only get you so far and you have crazy nesting, time to level up maybe? you may learn a lot from this
end)
end)
end
end
end
end
end
end``` https://www.youtube.com/watch?v=CFRhGnuXG-4
I'm a Never Nester and you should too.
Access to code examples, discord, song names and more at https://www.patreon.com/codeaesthetic
Correction: At 2:20 the inversion should be "less than or equal", not "less than"
every time i do that it automatically puts me to like another area
of the entire script
when i press enter
@hot sinew i took your "nest your code" thing and it somehow worked and made tweaks in my other script
and just removed the entire "stringmutationvalue" thing
also made the script a modulescript for some reason but still works
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
nevermind i lied it does the same thing
scratch everything i just said again
looking better but your chancesystem() function is still a giga function with insane nesting
i mean as long as it works right lol
that only applies to beginners
because in your case
it doesn't work now does it?
it works now