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

Will not :InvokeServer()?

Asked by
Razurix 10
9 years ago

ClientScript: (Placed in PlayerGui)

for i,v in pairs(game.Workspace:GetChildren()) do
    if v:IsA("Model") and v.Name == "HotelConsole" and v:FindFirstChild("CustomerConsole") then
        print("Console found")
        v.CustomerConsole.CD.MouseClick:connect(function(plr)
        print("Console clicked!")
        local Cash = plr.PlayerGui:WaitForChild("Stats").Cash
    if CustomerBusy == false and Cash.Value >= 500 and
        plr.PlayerGui.Stats.AwaitingConfirmation.Value ~= true and plr.PlayerGui.Stats.PlayerHasSuite.Value ~= true then
        print("Passed test")
        CustomerBusy = true
        v.SellerConsole.Beep:Play()
        print("Play beep")
        game.ReplicatedStorage.RemoteFunctions.CustomerFunction:InvokeServer(v)
        print("Sent request to server")
        CustomerBusy = false
        v.SellerConsole.Beep:Stop()
        print("Stop beep")
        end
            end)
                end
                    end

ServerScript: (Placed in ReplicatedFirst)

function game.ReplicatedStorage.RemoteFunctions.DoorFunction.OnServerInvoke(plr,model)
    if CustomerBusy == false then
        CustomerBusy = true
        plr.PlayerGui.Stats.AwaitingConfirmation.Value = true
        model.CustomerConsole.CD.MaxActivationDistance = 0
        model.CustomerConsole.CustomerName.Value = plr.Name
        model.SellerConsole.BrickColor = BrickColor.new("Lime green")
        model.SellerConsole.CD.MaxActivationDistance = 15
        end
            end

*print("Sent request to server") Does not print

Help?*

Answer this question