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 » Scripting Helpers
Home Search
 

Re: Why won't this work online?

Previous Thread :: Next Thread 
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
09 Jul 2012 10:51 PM
It works fine in solo, but it doesn't work online. I'm using it in a chat command as well, so there shouldn't be a problem with not finding me before I join the game, since I'm not telling it to run until after I join the game anyways.

player0 = game:GetService("Players").human
for i, v in pairs(game.Players:GetChildren()) do
local gui = Instance.new("ScreenGui", game.StarterGui)
gui.Name = "Blackout"
local frame = Instance.new("Frame", gui)
local textlabel = Instance.new("TextLabel", frame)
textlabel.Text = player0.Name.. " has you in a blackout"
textlabel.Position = UDim2.new(.5,0,.5,0)
textlabel.TextColor3 = Color3.new(255,255,255)
textlabel.FontSize = "Size18"
frame.Size = UDim2.new(1,0,1,0)
frame.BackgroundColor = BrickColor.new(0,0,0)
v.Character.Humanoid.Health = 0
end
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
09 Jul 2012 10:55 PM
Try this?

player0 = game.Players.human
for i, v in pairs(game.Players:GetChildren()) do
local gui = Instance.new("ScreenGui", game.StarterGui)
gui.Name = "Blackout"
local frame = Instance.new("Frame", gui)
local textlabel = Instance.new("TextLabel", frame)
textlabel.Text = player0.Name.. " has you in a blackout"
textlabel.Position = UDim2.new(.5,0,.5,0)
textlabel.TextColor3 = Color3.new(255,255,255)
textlabel.FontSize = "Size18"
frame.Size = UDim2.new(1,0,1,0)
frame.BackgroundColor = BrickColor.new(0,0,0)
v.Character.Humanoid.Health = 0
end
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
09 Jul 2012 10:56 PM
It don't wanna... Joke... player0 = game.Players.human

http://www.roblox.com/Forum/ShowPost.aspx?PostID=71965064
Report Abuse
DynamicVariable is not online. DynamicVariable
Joined: 20 Nov 2010
Total Posts: 466
09 Jul 2012 10:59 PM
This may not be your big problem, but your color ID's are slightly off:

If a am correct, Color3 is a value between 0 and 1, so you could write this

textlabel.TextColor3 = Color3.new(1,1,1)

In addition, BrickColor can hold either a string or integer value, such as this:

BrickColor.new("Really black")
BrickColor.new(25) -- Note, these two examples are probably not the same color


If I am wrong here, please correct me.
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
09 Jul 2012 11:01 PM

thanks!

player0 = game:GetService("Players").human was the problem, but why? isn't that the same thing as game.Players.human?
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
09 Jul 2012 11:02 PM
People can use Color3 as a range of 255 instead of one
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
09 Jul 2012 11:02 PM
No problem.. XD.


http://www.roblox.com/Forum/ShowPost.aspx?PostID=71965064
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
09 Jul 2012 11:03 PM
player0 = game:GetService("Players").human
for i, v in pairs(game.Players:GetChildren()) do
local gui = Instance.new("ScreenGui", game.StarterGui)
gui.Name = "Blackout"
local frame = Instance.new("Frame", gui)
local textlabel = Instance.new("TextLabel", frame)
textlabel.Text = player0.Name.. " has you in a blackout"
textlabel.Position = UDim2.new(.5,0,.5,0)
textlabel.TextColor3 = BrickColor.new("Your color").Color
textlabel.FontSize = "Size18"
frame.Size = UDim2.new(1,0,1,0)
frame.BackgroundColor = BrickColor.new("Your color").Color
v.Character.Humanoid.Health = 0
end


http://www.roblox.com/Forum/ShowPost.aspx?PostID=71965064
Report Abuse
DynamicVariable is not online. DynamicVariable
Joined: 20 Nov 2010
Total Posts: 466
09 Jul 2012 11:06 PM
Xnite, you mean to say that I've been dividing by 255 all these scripts for nothing?! That's great!
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
09 Jul 2012 11:06 PM
I don't think GetService really looks in Players, or it didnt run in server.
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
09 Jul 2012 11:08 PM
http://wiki.roblox.com/index.php/Color3
Report Abuse
human is not online. human
Joined: 06 May 2007
Total Posts: 2765
09 Jul 2012 11:10 PM
CeaselessSoul that didn't work, it seams GetService was the sole problem. :/ @xnite I'm using it for a different script and that works fine online, so idk why it doesn't work here.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
10 Jul 2012 12:44 AM
Oops, sorry, XD.
Report Abuse
DynamicVariable is not online. DynamicVariable
Joined: 20 Nov 2010
Total Posts: 466
10 Jul 2012 09:47 PM
Xnite, I couldn't help but notice that the wiki page you posted states, "Color3 values only range from 0 to 1." Although we would realy love to use a scale from 0 to 255 in color3, we still must divide these values by 255 to get them into correct form.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
10 Jul 2012 09:52 PM
The DynamicVariable is static and correct.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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