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

Remote function to get the VIPServerOwnerId isn't working, does anyone know why?

Asked by 5 years ago
Edited 5 years ago

So I've made a gui for owners of VIP Servers only, and when they press 'R' it should make it visible if they're the VIP server owner. But it's not doing anything - No errors either. I have a local script that calls a remote function to get the VIPServerOwnerId, but it's not working. Does anyone know why?

Local Script:

input = game:GetService("UserInputService")
open = false
player = game.Players.LocalPlayer
serverId = script.Parent.vipOwner:InvokeServer()
input.InputBegan:connect(function(input,inOtherInput)
    if inOtherInput ~= true then
        if input.KeyCode == Enum.KeyCode.R then
            print("Invoking")
            print(game.VIPServerOwnerId)
            if serverId == true then
                if open == false then
                script.Parent.Frame.Visible = true
                open = true
                else
                    script.Parent.Frame.Visible = false
                    open = false
                    end
            end
        end
    end
end)

Server Script:

print(game.VIPServerOwnerId)

script.Parent.vipOwner.OnServerInvoke=function(player)
    if player.UserId == game.VIPServerOwnerId then
        return true
    else return false
    end
end
0
I'm not sure if you can use a anonymous function for the on server invoke callback. Make a local function called getVipServerOwnerId(player) and use the same code in your anonymous function inside ur new local function and make OnServerInvoke = getVipServerOwnerId Impacthills 223 — 5y
0
I tried and it still didn't work. If it helps I think it's a client issue since it works in studio solo mode. BetterNotDie 11 — 5y

Answer this question