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

How come this is an error when i defined the sgui?

Asked by
oSyM8V3N 429 Moderation Voter
6 years ago

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)
0
Server scripts can’t access playergui’s stefdejup1 0 — 6y

Answer this question