Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

if plc.Value == "Job1" then print("test") doesn't work. How I can fix it? [SOLVED]

Asked by
Geko97 29
5 years ago
Edited 5 years ago

I literally spent last 2 hours trying to understand why my code does not work.

game.ReplicatedStorage.Job1.Privacidad.OnServerEvent:Connect(function(Player)
    local plc = game.ServerStorage.PlayerData[Player.Name].Place
    if plc.Value == "Job1" then
        print("test")
    end
end)

I checked so many times the value of "game.ServerStorage.PlayerData.MyPlayerName.Place" and definitely is "Job1".

It's 6 am in my country, my brain is burned.

0
Job1 y no job1? User#19524 175 — 5y
0
Y en donde esta el script? Solo ejecutan en ciertos lugares. User#19524 175 — 5y
0
Creo que el problema esta en que es un ObjectValue, porque acabo de probar cambiando a StringValue y ha funcionado, así que ni idea de que poner en if plc.Value == "Job1" que es donde yo creo que reside el problema Geko97 29 — 5y
0
Si es un ObjectValue tienes que hacer if plc.Value.Name porque Value es una referencia a un objeto si es ObjectValue. User#19524 175 — 5y
View all comments (4 more)
0
Vale, soy estúpido, ya lo he solucionado poniendo "game.Workspace.Job1". En fin, creo que no debería quedarme aprendiendo Lua hasta tan tarde. Gracias igualmente. Geko97 29 — 5y
0
Listo, ya lo he modificado, y muchísimas gracias por toda tu ayuda, he podido aprender por fin a usar los Remote Events gracias a ti xD. Un saludo! Geko97 29 — 5y
0
Gracias :) User#19524 175 — 5y
0
I think you should make "Job1" a table holamii2 45 — 5y

Answer this question