Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

dealergui is not a valid member of playergui?

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

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.

1 answer

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.

2 comments

0

i just checked, and everything seems to be the same.

0

I dont know why then

This discussion is preserved as it was. New answers, comments, and votes are closed.