|
| 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 |
|
|
|
| 14 Feb 2014 10:45 PM |
| game:GetService("HttpService"), not game.HttpService. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
| |
|
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 |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 18 Feb 2014 08:01 PM |
| There are no syntax errors, and all the variables are defined. |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|