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

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

Asked by
Fad99 286 Moderation Voter
5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by
Fad99 286 Moderation Voter
5 years ago

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

0
Put [Solved] in the name in order to stop people from visiting you're already solved post. songboy50 77 — 5y
0
ok Fad99 286 — 5y
Ad

Answer this question