generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Problably the easiest script ever, im just an idiot.

Previous Thread :: Next Thread 
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 02:51 PM
This is the code for a flag I have. Whenever someone on the red team touches it, it turns red. That works fine, but this won't work.


while true do
wait()
if script.Parent.BrickColor == BrickColor.new("Bright red") then
game.StarterGui.TEST.Part.Text = "Point 1 captured by raiders!"
end
end


Please help. I need it to say it to everyone in the server, thats why I didnt put it as a local script.
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 02:52 PM
Or i mean thats why I didnt refer to a player's playergui.
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
30 Mar 2015 02:52 PM
Check to see if the flag's brickcolor has changed, then add the if statement after that.
Report Abuse
lokkut is not online. lokkut
Joined: 18 Mar 2009
Total Posts: 1794
30 Mar 2015 02:52 PM
game.StarterGui.TEST.Part.Text = "Point 1 captured by raiders!"

loop through all palyers and change their gui individually

unless there's a new easier way and i'm being terribly inefficeint
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 02:53 PM
== “Bright red”



also changing the starter gui won’t work



Youll want to change everyones playerguis with a for loop
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 02:54 PM
Aren't I checking if the brickcolor is red in the if statement? I'm really bad at scripting.
Report Abuse
lokkut is not online. lokkut
Joined: 18 Mar 2009
Total Posts: 1794
30 Mar 2015 02:54 PM
== “Bright red”

that won't work

if BrickColor.new("Really red") ~= "Really red" then
print("hi")
end

prints hi
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 02:56 PM
Okay, so im doing lol's way, Now it is printing hi, but it isnt changing the gui. How do I look through every player's gui? Once again, I suck at scripting ;-;
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 02:57 PM
My b
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 03:00 PM
Halp please.... qq
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
30 Mar 2015 03:00 PM
Try this

local Players = game.Players:GetChildren

for i,v in pairs (Players) do
--code
end
Report Abuse
lokkut is not online. lokkut
Joined: 18 Mar 2009
Total Posts: 1794
30 Mar 2015 03:01 PM
local Players = game.Players:GetChildren()
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 03:01 PM
for _, p in pairs(game.Players:GetPlayers()) do
pg = p.PlayerGui
pg.TEST.Part.Text = “Point 1 captured by raiders"
end
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 03:09 PM
Klink's made an error, and the one above me made it so the text was always "Point 1 was captured by raiders"
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 03:12 PM
@Above thats what he wanted me to do lol
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 03:14 PM
No, I want the text to only be "point 1 captured by raiders" when the flag is red. I said that >;L
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 03:15 PM
Exactly, thats what i did.
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 03:17 PM

while true do
wait()
if script.Parent.BrickColor == BrickColor.new("Bright red") then
for _, p in pairs(game.Players:GetPlayers()) do
pg = p.PlayerGui
pg.TEST.Part.Text = “Point 1 captured by raiders”
end
end
end


U obviously have to put it in the loop dude
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
30 Mar 2015 03:17 PM
Try this instead sorry

local Players = game.Players:GetChildren()

for i,v in pairs (Players) do
--code
end
Report Abuse
lokkut is not online. lokkut
Joined: 18 Mar 2009
Total Posts: 1794
30 Mar 2015 03:18 PM
local Players = game.Players:GetPlayers()

for i = 1, #Players do
local n = Players[i].PlayerGui:findFirstChild("TEST")
if n then
n.Part.Text = "Point 1 captured by raiders!"
end
end

function changegui(visible)
for i = 1, #Players do
local n = Players[i].PlayerGui:findFirstChild("TEST")
if n then
n.Part.Text = "Point 1 captured by raiders!"
n.Part.Visible = visible
end
end
end

script.Parent.Changed:connect(function()
if script.Parent.BrickColor = BrickColor.new("Bright red") then
changegui(true)
else
changegui(false)
end
end)
Report Abuse
Curosity is not online. Curosity
Joined: 18 Aug 2010
Total Posts: 1085
30 Mar 2015 03:21 PM
YAS, THE EGG MAN'S SCRIPT WORKED! SUCCESS >:D
Report Abuse
bojigglesmister2 is not online. bojigglesmister2
Joined: 26 Jun 2011
Total Posts: 1421
30 Mar 2015 03:22 PM
Glad 2 help
Report Abuse
lokkut is not online. lokkut
Joined: 18 Mar 2009
Total Posts: 1794
30 Mar 2015 03:22 PM
sorry for the wall of text then

*cries*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image