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
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?