Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

:match is not a vaild member of player?

Asked by
moo1210 587 Moderation Voter
5 years ago

Code:

local module = require(game.ServerScriptService.Information)
local http = game:GetService("HttpService")
game.ReplicatedStorage.ClientRemotes.TrelloEventGet.OnServerInvoke = function(url,nocache)
    if url:match("?") then
        return http:GetAsync(url..'&key='..module.Key..'&token='..module.Token,nocache)
    else
        return http:GetAsync(url..'?key='..module.Key..'&token='..module.Token,nocache)
    end
    print("Completed HTTP GET request")
end

game.ReplicatedStorage.ClientRemotes.TrelloEventPost.OnServerInvoke = function(url,data)
    if url:match("?") then
        http:PostAsync(url..'&key='..module.Key..'&token='..module.Token,data)
    else 
        http:PostAsync(url..'?key='..module.Key..'&token='..module.Token,data)
    end
    print("Completed HTTP POST request")
end

I don't understand where a vaild memeber of player is coming from, I was trying to make a little test with this code, and it gives me its not a vaild memeber of player?

print(game.ReplicatedStorage.ClientRemotes.TrelloEventGet:InvokeServer("https://api.trello.com/1/boards/5tuNanLa",true))

The :match() worked with this test

local test = "hi445254353436324"
if test:match("hi")then
    print("works")
end

Anyone have any ideas?

1 answer

Log in to vote
2
Answered by
royaltoe 5144 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

First argument when a player invoke's a server is the player. Make the arguments for each of your functions: (player, url, nocache)

0
Thanks for your help! It works now. moo1210 587 — 5y
0
:-) royaltoe 5144 — 5y
Ad

Answer this question