Remote event not changing variable

hey, i’m working on a class system for a game, and for the class gui, i’m sending a local variable, which is the value of an intvalue in the gui to the server, my class weapon loading system works, but it doesn’t change class for some reason and comes out as 1, no matter what, here’s my client and server code with the main game parts omitted, the classid is also changed locally cliencode servercode

Your variable is only saving the value as soon as the script runs, instead you have to reference it as local classid = screen.classid to reference the Instance itself, but when you call your FireServer() event send it’s Value