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

[Solved]Why wont my UI show after touching part?

The Gui only shows after i jump off the baseplate, what am i doing wrong?

Sever Script (located in a part) :

local dad = script.Parent

local rep = game.ReplicatedStorage.RemoteEvent
game.Players.PlayerAdded:Wait()

function EventMsg(part)
local parent = part.parent

if game.Players:GetPlayerFromCharacter(parent)then
	rep:FireAllClients(parent)
end

end

  
dad.Touched:Connect(EventMsg)

Heres The Script that actually fires the UI (located in StarterGui):

  local rep = game.ReplicatedStorage.RemoteEvent

  
rep.OnClientEvent:Connect(function(player)
local GUI = Instance.new("ScreenGui")
GUI.Name = "Gui"
local Text = Instance.new("TextLabel")
Text.Text = player.Name.." Activated a Server Event!"

if not game.StarterGui:FindFirstChild("Gui")then
	Text.Size = UDim2.new(0,1650,0,50)
	GUI.Parent = game.StarterGui
	Text.Parent = GUI
end

wait(2)
print(GUI.Parent)
print(Text.Text)
end)

1 answer

Never Mind i fixed the script, what i had to do was move the GUI to the parent of the script

2 comments

0

Put [Solved] in the name in order to stop people from visiting you're already solved post.

0

ok

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