Server:
game:GetService("ReplicatedStorage"):WaitForChild("FunctionStorage"):WaitForChild("Request").OnServerInvoke = function(player,Request)
warn(player,Request)
if Request == "Statistics" then
local Info = field:getInfo()
warn("Getting Info!")
return Info
end
end
So it never warns player or request. I ran this line of code in the out put at it did show that it was being invoked
game:GetService("ReplicatedStorage"):WaitForChild("FunctionStorage"):WaitForChild("Request").OnServerInvoke = function(player,Request) warn(player,Request) end
Warning: zeyan200_gotdeleted Statistics
But the returned value is always nil
Client:
self["Stats"] = FunctionStorage:FindFirstChild("Request"):InvokeServer("Statistics")
task.wait()
if self["Stats"] == nil then
warn("Stats | Nil ", self["Stats"])
task.wait(0.8)
if self["Stats"] == nil then
field:GetInfoAsync()
end
end
4 Likes
Forummer
(Forummer)
March 28, 2024, 1:45pm
#2
Try print(Info)
before return Info
to see if ‘Info’ is a non-nil value.
3 Likes
Ok but warn("Getting Info!")
doesnt actually run so I dont think that this will.
1 Like
Unfortunately It did not print at all.
Forummer
(Forummer)
March 28, 2024, 1:51pm
#5
FunctionStorage:FindFirstChild
You may need to change this to ‘WaitForChild’.
3 Likes
That wouldn’t do much due to this line being at the top of both of those script’s.
wastbo
(DanCodes)
March 28, 2024, 1:54pm
#7
Using WaitForChild and declaring it as a variable would be better but that’s not the issue rn. What’s the field info thing?
1 Like
The field:getInfo()
Function is this
function field:getInfo()
local Votes
local Details
local Info = MarketplaceService:GetProductInfo(game.PlaceId)
Votes = HttpService:JSONDecode(HttpService:GetAsync("https://games.roproxy.com/v1/games/"..game.GameId.."/votes"))
Details = HttpService:JSONDecode(HttpService:GetAsync(`https://games.roproxy.com/v1/games?universeIds={game.GameId}`))
return {
["Thumbnail"] = "rbxassetid://".. Info.IconImageAssetId,
["Name"] = Details.name or "N/A",
["Description"] = Details.description,
-- Stats
["Active"] = Details.playing or "N/A",
["Visits"] = Details.visits or 0,
["Favorites"] = Details.favoritedCount or "N/A",
["Creator"] = Details["creator"],
["Updated"] = Info.Updated,
["Created"] = Info.Created,
-- Votes
["Likes"] = Votes.upVotes or "N/A",
["Dislikes"] = Votes.downVotes or "N/A",
}
end
Edit: And like I said in my post above there is no need for a WaitForChild()
wastbo
(DanCodes)
March 28, 2024, 2:03pm
#9
Well there’s no need for it because you used a less efficient method for it. Is your script in somewhere other than server script service?
SelDraken
(SelDraken)
March 28, 2024, 2:06pm
#11
sjxcns:
warn(player,Request)
What is this showing as output?
1 Like
wastbo
(DanCodes)
March 28, 2024, 2:07pm
#12
It’s not printing for them at all
1 Like
It is getting outputted here on the client side
wastbo
(DanCodes)
March 28, 2024, 2:08pm
#14
Is analytic service being required? That’s the only reason I can think of it not working
SelDraken
(SelDraken)
March 28, 2024, 2:09pm
#16
I don’t have my studio open, its updating as usual, but don’t you need a :Connect in here somewhere, or am I thinking of something totally different?
Forummer
(Forummer)
March 28, 2024, 2:10pm
#17
Connect
would be for ‘RemoteEvent’ instances, they are using a ‘RemoteFunction’ instance.
3 Likes
You don’t use :Connect
when it comes to remote and bindable functions.
wastbo
(DanCodes)
March 28, 2024, 2:11pm
#19
And the services script is also getting required?
SelDraken
(SelDraken)
March 28, 2024, 2:11pm
#20
Sorry, my bad. Once my studio loads, I’ll copy your code, and the remote events and see if I can help figure it out.
1 Like