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)
--[[ 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)
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.