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

I want this gui to be put on everybodies screen but so far it’s only been put on mine. Any tips?

Asked by
Na_n 0
6 years ago
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = "rbxassetid://"..148830028
sound.Playing = true
sound.Looped = true

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.CoreGui -- I know it's something to do with this line but I don't know what to do


local frame = Instance.new("Frame")
frame.Parent = screenGui
frame.Position = UDim2.new(0.4,0 , 0.4, 0)
frame.Size = UDim2.new(0.2, 0, 0.1, 0)
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1

local textlabel = Instance.new("TextLabel") 
textlabel.TextColor3 = Color3.fromRGB(255, 179, 217)    
textlabel.BorderSizePixel = 1
textlabel.BackgroundTransparency = 1
textlabel.Parent = frame
textlabel.Text = "EXAVISTS WERE HERE"
textlabel.Position = UDim2.new(-2,0 , -1, 0)
textlabel.Size = UDim2.new(5, 0, 2, 0)
textlabel.TextScaled = true
textlabel.Font = "HighWay"
0
Are u trying to get the same message on everyone screen SilentGalaxZy 53 — 6y

3 answers

Log in to vote
0
Answered by 6 years ago
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = "rbxassetid://"..148830028
sound.Playing = true
sound.Looped = true

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer.PlayerGui -- I know it's something to do with this line but I don't know what to do


local frame = Instance.new("Frame")
frame.Parent = screenGui
frame.Position = UDim2.new(0.4,0 , 0.4, 0)
frame.Size = UDim2.new(0.2, 0, 0.1, 0)
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1

local textlabel = Instance.new("TextLabel") 
textlabel.TextColor3 = Color3.fromRGB(255, 179, 217)    
textlabel.BorderSizePixel = 1
textlabel.BackgroundTransparency = 1
textlabel.Parent = frame
textlabel.Text = "EXAVISTS WERE HERE"
textlabel.Position = UDim2.new(-2,0 , -1, 0)
textlabel.Size = UDim2.new(5, 0, 2, 0)
textlabel.TextScaled = true
textlabel.Font = "HighWay"


Tell me if that works.

Ad
Log in to vote
0
Answered by 6 years ago
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = "rbxassetid://"..148830028
sound.Playing = true
sound.Looped = true

for i,v in pairs(game.Players:GetChildren()) do 
    local screenGui = Instance.new("ScreenGui") 
    screenGui.Parent = v.PlayerGui


    local frame = Instance.new("Frame")
    frame.Parent = screenGui
    frame.Position = UDim2.new(0.4,0 , 0.4, 0)
    frame.Size = UDim2.new(0.2, 0, 0.1, 0)
    frame.BorderSizePixel = 0
    frame.BackgroundTransparency = 1

    local textlabel = Instance.new("TextLabel") 
    textlabel.TextColor3 = Color3.fromRGB(255, 179, 217)    
    textlabel.BorderSizePixel = 1
    textlabel.BackgroundTransparency = 1
    textlabel.Parent = frame
    textlabel.Text = "EXAVISTS WERE HERE"
    textlabel.Position = UDim2.new(-2,0 , -1, 0)
    textlabel.Size = UDim2.new(5, 0, 2, 0)
    textlabel.TextScaled = true
    textlabel.Font = "HighWay"
end

This should make everyone have the gui

Log in to vote
0
Answered by
xEiffel 280 Moderation Voter
6 years ago

I think you'll need to use the Instance :GetChildren() do do this method

I have made code inline explaining the lines I have added.

local players = game:GetService("Players"):GetChildren() -- Gets all the current players in the Players Service
local sound = Instance.new("Sound")
sound.Parent = game.Workspace
sound.SoundId = "rbxassetid://"..148830028
sound.Playing = true
sound.Looped = true

local screenGui = Instance.new("ScreenGui")
for i = 1, # players do -- Grabs all avaliable children from the Players Service
screenGui.Parent = players[i].PlayerGui -- Sends to PlayerGui
end
local frame = Instance.new("Frame")
frame.Parent = screenGui
frame.Position = UDim2.new(0.4,0 , 0.4, 0)
frame.Size = UDim2.new(0.2, 0, 0.1, 0)
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1

local textlabel = Instance.new("TextLabel") 
textlabel.TextColor3 = Color3.fromRGB(255, 179, 217)    
textlabel.BorderSizePixel = 1
textlabel.BackgroundTransparency = 1
textlabel.Parent = frame
textlabel.Text = "EXAVISTS WERE HERE"
textlabel.Position = UDim2.new(-2,0 , -1, 0)
textlabel.Size = UDim2.new(5, 0, 2, 0)
textlabel.TextScaled = true
textlabel.Font = "HighWay"

Hope this helped; Learn about the Instance GetChildren() here!

http://wiki.roblox.com/index.php?title=API:Class/Instance/GetChildren

Answer this question