NEW VERSION: https://scriptinghelpers.org/questions/73462/why-wont-my-if-statement-read-my-string-value-answered
Why wont this work
if game.ReplicatedStorage.MapLoader.Value == "map1" then
print("Test")
end
NEW VERSION: https://scriptinghelpers.org/questions/73462/why-wont-my-if-statement-read-my-string-value-answered
Why wont this work
if game.ReplicatedStorage.MapLoader.Value == "map1" then
print("Test")
end
if game.ReplicatedStorage.MapLoader.Value == 1 then
print("Test")
end
use game:GetService("ReplicatedStorage") also add your waitforchilds
You need to explain the script.
this is my exact script but the number 1 instead of map 1
Sometimes it’s best if the if statement is less direct and more variable, although it works both ways. Try this anyway
local ReplicatedStorage = game:GetService(“ReplicatedStorage”) --//more efficient method of indexing
local MapLoader = ReplicatedStorage:WaitForChild(“MapLoader”).Value --//helps to yield so the script doesn’t break or check f something is ‘nil’
if (MapLoader == 1) then
print(“Okay”)
end
There are also things that could cause the issue, for instance, check if you accidentally disabled the script?
your if statement doesnt make sense at all and will error
Your if statement would have syntax error. Correction: if ((MapLoader > 0) and (MapLoader < 2)){...}
Also congratulations on 100 rep.
Thanks, I also know that, I was just trying something because why not?;) I’ll fix, thanks guys
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
is it a localscript or script
5_zn I posted a fix for you
Could you explain more? Give me the details about MapLoader and what is is it whatever your checking
its a local script