This is the error :
11:20:33.686 - ServerScriptService.StatsOpener:7: attempt to index local 'sgui' (a nil value)
11:20:33.687 - Stack Begin
11:20:33.688 - Script 'ServerScriptService.StatsOpener', Line 7
11:20:33.689 - Stack End
And this is the script that has the error inside :
local Event = game:GetService("ReplicatedStorage"):WaitForChild("Stats")
local rep = game:GetService("ReplicatedStorage")
Event.OnServerEvent:Connect(function(player)
local sgui = player.PlayerGui:FindFirstChild("PlayerGuis")
sgui:FindFirstChild("Menu").StatsGui:TweenPosition(UDim2.new(0.5, -87, 0.5, -200), "Out", "Quart", 2, true)
end)

1 comment
Server scripts can’t access playergui’s