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

1 comment
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.