LocalScript. buyButton is a SurfaceGui button. Both descend from PlayerGui.
buyButton.MouseButton1Click:connect(function()
if tonumber(func:InvokeServer({"GetToolLastPurchased", toolsToRentOrBuy[index][1]})) > 60*60*24--[[24 hours Also on Script line 71]] then --Line 59
--snip
else
--Already purchased recently
end
end)
Script, descendant of Workspace.
local func = Instance.new("RemoteFunction", Game:GetService("ReplicatedStorage"))
func.Name = "inspiredMessage" --To avoid potential name conflicts.
function func.OnServerInvoke(player, args)
if args[1] == "GetToolLastPurchased" then
local testVar = store:GetAsync(player.Name)
if not testVar or testVar == "Request rejected" then
return math.huge
elseif not testVar[args[2]] then
return math.huge
else
return Tick() - testVar[args[2]]
end
--snip
end
end
Output (From Client, not Server):
22:54:48.521 - Request rejected
22:54:48.522 - Script 'Players.Player1.PlayerGui.LocalScript', Line 59
22:54:48.523 - stack end
22:54:48.524 - Players.Player1.PlayerGui.LocalScript:59: attempt to compare number with nil
22:54:48.525 - Script 'Players.Player1.PlayerGui.LocalScript', Line 59
22:54:48.526 - stack end
"Request rejected" is a string returned by GetAsync when trying to access a DataStore from a test Server, which I am.
My problem is that "Request rejected" is getting sent to the Client, not math.huge which I am expecting. The LocalScript isn't breaking, but I can't figure out how to make this work as I expect it to.
Any help?

1 comment
Kenetec or whoever, please add some sort of Output button, similar to the SyntaxHighlighter, but for ROBLOX Output.