#very simple script isnt working

1 messages · Page 1 of 1 (latest)

open sandal
#

image attached, the script literally just does nothing. i dont understand why. it's very upsetting.

#

located here for context, no other scripts affect it

cursive gate
open sandal
cursive gate
#

but not code unless it's a module

open sandal
#

serverscriptservice is annoying because whenever i run the game to test it, everything in serverscriptservice vanishes

#

but i think its working, thank you for your time

cursive gate
open sandal
#

is there any means to see scripts in serverscriptservice while playtesting?

cursive gate
#

if you swap to server you can

#

(From the docs)

open sandal
#

ah cheers

#

the script still doesn't wanna do anything it would seem

#

this is fun! 🔥 coding is fun! 🔥

sly heronBOT
#

studio** You are now Level 3! **studio

cursive gate
#

because you defind the value at the start

#

instead of doing noise = var.Value before the loop, do it in the loop.
Also, never do a while true do loop with no wait, you need to add task.wait() to the end.

open sandal
cursive gate
#

Or instead of always trying to change the value, only do it when the Value is changed.
Example:

local var = game.ReplicatedStorage.NoiseAggression
var:GetPropertyChangedSignal("Value"):Connect(function()
  -- Limit it here instead
end)
cursive gate
open sandal
#

though it still doesnt seem to be working

open sandal
cursive gate
#

what's your code now?

open sandal
#

this currently

#

though i tried this too

#

neither work

#

maybe the variable needs to be in a different spot in the game hierarchy?

cursive gate
open sandal
#

this is very frustrating for how simple the script is meant to be hey haha

cursive gate
#

where are you changing the value

#

if it's being changed by a LocalScript, the server won't be able to see

#

you can test what the server can see if you're in-game with the view said to server, like I said before

open sandal
#

i reverted back to this old code with the print for the time being

#

and it is printing the value at 105 (which is the default i set it to)

#

but it isnt updating it

cursive gate
#

because it's setting the variable, not the Value

#

instead of doing noise = 100, do var.Value = 100

#

they are different things

open sandal
#

they arent though, are they?

#

noise = var.Value

cursive gate
#

The noise is a integer variable that is initialized with the value of var.Value, not a reference to var.Value. When var.Value changes, noise will not change & when noise changes, var.Value does not change.

sly heronBOT
#

studio** You are now Level 5! **studio

open sandal
#

ah

#

so then there's no reason to define noise at all, is there?

cursive gate
#

not really

#

also, you could just do var.Value = math.clamp(var.Value, 0, 100)

#

which will clamp it between 0-100

open sandal
#

that works perfectly

#

thank you you absolute legend