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
 

why won't this work...

Previous Thread :: Next Thread 
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
14 Feb 2014 10:44 PM
LocalScript:
ab = scrgui["About You"].TabContainer.AboutYou
ab.FriendCount.Text = ("Friend Count: "..game.HttpService:GetAsync("http://www.robloxapi.com/Users/FriendCount.php", script.Parent.Parent.userId))
ab.Forum.Text = ("Forum Posts: "..game.HttpService:GetAsync("http://www.robloxapi.com/Users/ForumPostCount.php", script.Parent.Parent.userId))
ab.Kos.Text = ("KOs: "..game.HttpService:GetAsync("http://www.robloxapi.com/Users/KnockoutCount.php", script.Parent.Parent.userId))


Output:
23:43:09.734 - HttpService is not a valid member of DataModel
23:43:09.734 - Script 'Players.Player1.PlayerGui.New', Line 1200 - global SetupAboutYou
23:43:09.734 - Script 'Players.Player1.PlayerGui.New', Line 2132
23:43:09.734 - stack end
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
14 Feb 2014 10:45 PM
game:GetService("HttpService"), not game.HttpService.
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
16 Feb 2014 09:42 AM
okay thanks:)
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
16 Feb 2014 12:21 PM
didn't help here is the script

vab = scrgui["About You"].TabContainer.AboutYou
ab.FriendCount.Text = ("Friend Count: "..game.GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/FriendCount.php", script.Parent.Parent.userId))
ab.Forum.Text = ("Forum Posts: "..game.GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/ForumPostCount.php", script.Parent.Parent.userId))
ab.Kos.Text = ("KOs: "..game.GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/KnockoutCount.php", script.Parent.Parent.userId))
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
16 Feb 2014 12:26 PM
While in Roblox Studio, you need to manually access HttpService and Enable it.
Type this into the command bar
game:GetService'HttpService'.HttpEnabled=true

then your scripts using the HttpService will work
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
16 Feb 2014 12:32 PM
I did that aready
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
16 Feb 2014 12:36 PM
GetService is not just a function, but a method. It must be called with a colon, as opposed to being called as an index.

game:GetService
not game.GetService
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
16 Feb 2014 12:37 PM
okay
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
16 Feb 2014 12:40 PM
still didn't wor here is the current script:
ab = scrgui["About You"].TabContainer.AboutYou
ab.FriendCount.Text = ("Friend Count: "..game:GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/FriendCount.php", script.Parent.Parent.userId))
ab.Forum.Text = ("Forum Posts: "..game:GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/ForumPostCount.php", script.Parent.Parent.userId))
ab.Kos.Text = ("KOs: "..game:GetService("HttpService"):GetAsync("http://www.robloxapi.com/Users/KnockoutCount.php", script.Parent.Parent.userId))
Report Abuse
iIikeyou is not online. iIikeyou
Joined: 07 Mar 2012
Total Posts: 1659
16 Feb 2014 12:42 PM
There's no syntax errors in the script that I can see.
Are there any errors? If not, make sure scrgui is defined, and all of the children's names are correct.
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
18 Feb 2014 08:01 PM
There are no syntax errors, and all the variables are defined.
Report Abuse
shadownetwork is not online. shadownetwork
Joined: 06 Feb 2014
Total Posts: 296
21 Feb 2014 01:21 PM
help please
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
21 Feb 2014 01:45 PM
Eurgh.

1) If you had directed the request in the right direction you would get a JSON encoded table. Therefore, your "Friends Count" would look like "Friend Count: {"UserId":"1","Knockouts":"3330"}"

Look into the JSONDecode method.

2) Work this how you need it.
HttpService:GetAsync("http://www.robloxapi.com/Users/KnockoutCount.php?UserId="..UserID)
HttpService:GetAsync("http://www.robloxapi.com/Users/ForumPostCount.php?UserId="..UserID)
HttpService:GetAsync("http://www.robloxapi.com/Users/FriendCount.php?UserId="..UserID)

3) You would have gotten an error. The second argument of GetAsync is to to about caching, and it's expecting a bool not a string.
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