Hello!
I am wondering why my elseIf statement isn't working correctly. As, when the value is set at 0, it prints out Hi. However, when the value is set at 1, and I click on my gui. It does not print anything at all! I would appreciate some help. As I have spend an hour on this and can't seem to figure it out.
local Gui = script.Parent.Picture local ReplicatedStorage = game:GetService("ReplicatedStorage") local Event = ReplicatedStorage:WaitForChild("Events").SaveDataReturn Gui.MouseButton1Down:Connect(function() Event:InvokeServer() local Value = ReplicatedStorage.Return.SaveData if Value == 0 then print("Hi") elseif Value == 1 then print("Tween") end end)
On line 15 you have put
local Value = ReplicatedStorage.Return.SaveData
If ReplicatedStorage.Return.SaveData is a Value object then instead of that you must place:
local Value = ReplicatedStorage.Return.SaveData.Value
If its not that, then please give information on what exactly is ReplicatedStorage.Return.SaveData so I may help you.