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

Screen Gui Help?: Make it appear to all players with a script

Hello! I Need Help With a Script im making for pranks, so im trying to make a warning message. Then i test it and it only appears on my screen, not in the other players screens.

@ is the part i need help with

-- Script Created By TheEdyGamerTroll23
-- m8 Use This Script if you wanna make people scare them selves xD
@@@local TehNuclear = Instance.new("ScreenGui",game.Players.PlayerGui)
TehNuclear.Name = "nuclearWARNING"@@@
local WarningText = Instance.new("TextLabel",TehNuclear)
local Welcome = Instance.new("TextLabel",TehNuclear)
local Alarm = Instance.new("Sound",workspace)
Alarm.SoundId = "http://www.roblox.com/asset/?id=798041696"
Alarm.Looped = true
local PushButton = Instance.new("TextButton", TehNuclear)
PushButton.Parent = TehNuclear


PushButton.BackgroundColor3 = Color3.fromRGB(0,0,0)
PushButton.BorderColor3 = Color3.fromRGB(255,0,0)
PushButton.BorderSizePixel = 2
PushButton.Position = UDim2.new(0.903, 0,0.791, 0)
PushButton.Size = UDim2.new(0, 132,0, 50)
PushButton.Visible = false
PushButton.Style = "RobloxButtonDefault"
PushButton.Font = "SourceSansBold"
PushButton.Text = "NUKE PRANK IT"
PushButton.TextColor3 = Color3.fromRGB(255,255,255)
PushButton.TextSize = 22
WarningText.BackgroundColor3 = Color3.fromRGB(0,0,0)
WarningText.BorderColor3 = Color3.fromRGB(255, 85, 0)
WarningText.BorderSizePixel = 4
WarningText.Position = UDim2.new(0.156, 0,0, 0)
WarningText.Size = UDim2.new(0, 1064,0, 56)
WarningText.Visible = false
WarningText.Font = "SourceSansBold"
WarningText.TextSize = 28
WarningText.Text = "WARNING: A NUCLEAR MISSILE IS HEADING INTO YOUR LOCATION, Please Evacuate and Get to Safety"
WarningText.TextColor3 = Color3.fromRGB(244, 85, 0)
Welcome.BorderColor3 = Color3.fromRGB(0,0,0)
Welcome.BorderColor3 = Color3.fromRGB(255, 85, 0)
Welcome.BorderSizePixel = 4
Welcome.Position = UDim2.new(0.156, 0,0, 0)
Welcome.Size = UDim2.new(0, 1064,0, 56)
Welcome.Visible = false
Welcome.Font = "SourceSansBold"
Welcome.TextSize = 28
Welcome.Text = "Script By TheEdyGamerTroll23!"
Welcome.TextColor3 = Color3.fromRGB(244, 85, 0)

wait(2)
Welcome.Visible = true
wait(3)
PushButton.Visible = true
Welcome.Visible = false

PushButton.MouseButton1Click:connect(function()
	WarningText.Visible = true
	Alarm:Play()
	warn("LOL")
end)



6 comments

0

line three: @@@local TehNuclear = Instance.new("ScreenGui",game.Players.PlayerGui) this is not how it works.. you need to make a for loop then use it to get their player gui

0

how?

0

for _, v in pairs(game.Players:GetChildren()) do local TehNuclear = Instance.new("ScreenGui",v) end -- there, allows you to send the same gui to all players

0

He's using a localscript so he can use the localplayer lol

0

im not using a local script

0

doing that my gui dosen´t appear

3 answers

I Trying to press a button and everyone get warned by the alert sound and Textlabel

game.Players.PlayerAdded:connect(function()
	--Code you posted
	local function scare()
		WarningText.Visible = true
    		Alarm:Play()
    		warn("LOL")
	end
	PushButton.MouseButton1Click:connect(function()
    		scare()
	end)
end)

If what you wanted was for every player to be affected when the button is pressed then you'd need to use a remoteEvent.

1 comment

0

not necessarily..

--[[
Script for your prank button
--]]
button = script.Parent
sound = script.Parent.Sound -- If you want a jump scare :)
button.MouseButton1Down:Connect(function()
	sound:Play()
	for _,v in pairs(game.Players:GetPlayers()) do
		v.PlayerGui.ScreenGui.TextLabel.Text = "GOTCHA!"
		v.Character.Humanoid.Health = 0 -- Why not xD
	end
end)

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