this is a part of the local script:
local found = game:GetService("Players").LocalPlayer:FindFirstChild("Backpack") if found then script.Parent.RemoteEvent:FireServer()
this is the regular script:
script.Parent.RemoteEvent.OnServerEvent:Connect(function() game.Players.LocalPlayer.Backpack.Values.Level.Value = 1 game.Players.LocalPlayer.Backpack.Values.PlayedValue.Value = 1 end)
works perfect in studio but in the actual game it still acts like a local script or it doesnt work at all. no errors appear.
Your problem is that you cannot access LocalPlayer through a server side script.
However, when you use FireServer()
the player is automatically sent to the server side script. So to fix this, just change your regular script to this.
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player) player.Backpack.Values.Level.Value = 1 player.Backpack.Values.PlayedValue.Value = 1 end)
Aaaaaaa~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~