Okay, so I wanna start by checking if the class that was sent was 1 (economy). If it is, I give the player the economy card, so I tried to rename the backpack to hi just to test (of course I can't do that, I'm not dumb.) but the error I got even before when I was trying to rename the backpack was as follows:
Player is not a valid member of Players
Serverside code:
local revent = game:GetService('ReplicatedStorage').class
local function test (Player,classes)
if classes == 1 then
game.Players.Player.Backpack.Name = 'hi'
end
end
revent.OnServerEvent:Connect(test)
Clientside code:
local revent = game.ReplicatedStorage:WaitForChild('class')
local classes = 1
local Player = game.Players.LocalPlayer
local frame = script.Parent.Parent.Parent
local frame2 = script.Parent.Parent.Parent.Parent.endpoint_pass
script.Parent.MouseButton1Click:Connect(function()
frame:TweenPosition(UDim2.new(1, 0,0, 0), 'Out', 'Quint', '1')
frame2:TweenPosition(UDim2.new(0, 0,0, 0), 'Out', 'Quint', '1')
script.Parent.Parent.Parent.Parent.exit.Visible = false
revent:FireServer(classes)
end)
also, I know I didn't put players in the serverside code, if I did, the script encountered this error:

6 comments
what line is the error one?
*on
Line 4 in serverside code
The issue is Player is not a valid member of Players, even though it should be because it's always passed over by default, right?
Wrong its only referenced by remotes events and I think gamepasses etc make sure you referenced player.
First try making a loop after if classes = 1 then to find the backpack then change the name of it also,you dont do