So inside a birck is this script:
1 | local AI = game.ServerStorage.FredAI.Value |
2 | if AI = = 1 |
3 | then |
4 |
5 | print ( "Test" ) |
6 | script.Parent.Transparency = 1 |
7 | end |
However, "Test" is never printed and the block never changed its transprency.
I know that the value changes, as I have a script to print the current value some time after the value is changed, and it says 1, also I hit run and watched the value chaged.
Any solutions?
hello, Adenandpuppy. I've brought up a couple of solutions.
SOLUTION 1
Solution 1 is pretty simple you create a while true do loop to constantly check the value.
1 | local AI = game.ServerStorage.FredAI |
2 |
3 | while true do |
4 | wait() |
5 | if AI.Value = = 1 then |
6 | script.Parent.Transparency = 1 |
7 | end |
8 | end |
SOLUTION 2
If the script you are using is an localscript then you simply cannot access serverstorage. Instead use replicatedstorage as both normal scripts and localscripts can access the contents of it.
--
I hope this helps!
// hydrogyn