You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I’d like my script to change the number inside of a value when I press a button.
What is the issue? Include screenshots / videos if possible!
The button function works fine, but the value does not update.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve looked on the DevForums but pretty much everyone is asking how to change a value locally.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local ClickDetc = script.Parent:WaitForChild("ClickDetector")
local Value = script.Parent.Parent.Parent:WaitForChild("Sirens").Value
ClickDetc.MouseClick:Connect(function(player)
Value = 1
ClickDetc.MaxActivationDistance = 0
wait(5)
ClickDetc.MaxActivationDistance = 32
Value = 0
end) ```
I’ve only added the vars that seem needed. As said, the entirety of the script is working fine besides the “Value = 1” or “Value = 0”
I honestly feel like this is a really easy question, but I am just stumped.
May I ask if this is a Server Sided Script or a Local Sided Script? Also, is it perhaps working if you do script.Parent.Parent.Parent["Sirens"].Value = ... ?
This is a server sided script. The script is for a gate that has a light with another script that makes the light function, but the light only looks for a value. (I’m just using some free model that I found off of the toolbox)
I think it’s becouse [anyValue].Value means only true or false, you can’t introduce a value with just .Value becouse it needs to be true or false. Hope this is quite understanding.