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

GUI won't appear when it is in Workspace File?

Hello! I have spent hours trying to fix where I put my GUI in the Game.Workspace and it did not work. But, when I try Game.StartingGUI and it did work. I was building a speedometer for the car, but nothing come up. I also tried to use GUI.Visible = True, but it didn't work. If you don't understand, then I will make it more explainable.

3 comments

0

You need to Insert a ScreenGui into StarterGui and put your visible objects, like Frames, TextLabels, Images.. etc inside it. 

0

If you want to tamper with GUIObjects direcly to a Player, you have to reference their PlayerGui

0

Yet any GUI when being designed must always reside in it's primary Service, StarterGui. Even afterward.

1 answer

GUIs only appear locally, therefor you have to put it in StarterGui and add "Frame"s or ect. to the ScreenGui, if you want the Gui to appear when someone sits in a car, put the gui in ReplicatedStorage(or Workspace), and then if it's when they sit in the car have the seat have a script with this Script;

local RS = game:GetService("ReplicatedStorage")

script.Parent.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if part.Parent.Humanoid.Sit == true then
			local clone = RS.Speedometer:Clone()
			clone.Parent = game.Players[part.Parent.Name].PlayerGui
		end
	end
end)

There might be better ways, but this is how i would go about it

3 comments

0

NOTE: if you put the GUI in workspace instead of ReplicatedStorage, just change RS to game.Workspace

0

Do i put the sxript inside the model(car) or inside RS?

0

Since i assume you want this when the player sits in the car, it would be placed in the seat

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