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

Remote event invocation queue exhausted did you forget to implement OnServerEvent, any ideas?

Asked by
Echtic 128
5 years ago

Here's the script:

wait()

local players = game:GetService("Players")
local player = players.LocalPlayer
local UserInputService = game:GetService("UserInputService")

local ev = workspace.Events.FloatFruitEvents.FloatingE
local ev2 = workspace.Events.FloatFruitEvents.FloatingoffE
local ev3 = workspace.Events.FloatFruitEvents.FloatingEv

local mouse = player:GetMouse()
local character = player.Character


UserInputService.InputBegan:Connect(function(key,gameProcessed)

    if(gameProcessed) then return end

    if key.KeyCode == Enum.KeyCode.F then 

    ev3.Script.Disabled = false

    wait()

local camera = workspace.CurrentCamera
camcf = camera.CFrame

    ev:FireServer(camcf)

    local currentLookVector = camera.CFrame.LookVector

camera:GetPropertyChangedSignal("CFrame"):Connect(function()

    if(camera.CFrame.LookVector ~= currentLookVector)then

        currentLookVector = camera.CFrame.LookVector


    print("look vector changed")

    camcf = camera.CFrame
    ev3:FireServer(camcf)
    end

    end)
end

end)


UserInputService.InputEnded:Connect(function(key,gameProcessed) 

    if(gameProcessed) then return end

    if key.KeyCode == Enum.KeyCode.F then 


    ev2:FireServer()

    ev3.Script.Disabled = true

end

end)
0
I assume this connection: camera:GetPropertyChangedSignal("CFrame"):Connect(function() is firing the ev3 remote too often, what do you need the camera's CFrame for? SerpentineKing 3885 — 5y
0
I need it constantly updated in order for the bodyvelocity to always point where the camera is pointing, basically it's a flight script where the direction of the flight is controlled by the camera. Echtic 128 — 5y

Answer this question