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

dealergui is not a valid member of playergui?

Asked by 5 years ago

i made a script that sets a value from a name. but it keeps giving me dealergui is not a valid member of playergui.

script that calls the event:

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.Visible = false
    script.Parent.Parent.Parent.Frame.Visible = false
    script.Parent.Parent.Parent.Frame2.Visible = true
    script.Parent.Parent.Parent.CarMenu.Visible = true
    script.Parent.Parent.Parent.CarMenu.TextLabel.Text = "AcCobra"
    game.ReplicatedStorage.CarToBuy:FireServer("AcCobra")
    local e = game.ReplicatedFirst.AcCobra:Clone()
    e.Parent = game.Workspace.CurrentCamera
    e:SetPrimaryPartCFrame(game.Workspace.dealertp.CFrame)
end)

event script:

game.ReplicatedStorage.CarToBuy.OnServerEvent:Connect(function(player,name)
       player:WaitForChild("PlayerGui").DealerGui.CarToBuy.Value = name
end)

thanks

0
You cannot access PlayerGui in FE, for this you need to access with cilent, or use `:FireClient()`, you can create a BoolValue by the server, and if the BoolValue is true you can make the GUI visible is simple. yHasteeD 1819 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Its hard to see if DealerGui is not a valid member of PlayerGui. You need to check for yourself if you wrote your Variable correctly. Check if you wrote everything correctly and you did no typo. Reasons for that Error could be that you wrote the wrong path or your actuall DealerGui has no upper D and upper G and i completly small written. Check all that and it should be good to go.

0
i just checked, and everything seems to be the same. ieatandisbaconhair 77 — 5y
0
I dont know why then Paintertable 171 — 5y
Ad

Answer this question