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

My RemoteEvent wont fire, but there's no errors in the output? [SOLVED]

Asked by
Zeluxis 100
5 years ago
Edited 5 years ago

Hi,

From a key being pressed in a PlayerGui, it should fire the event in the model in game. This key is being registered correctly and it is also being successfully identified. It just wont fire.

Anyone know why?

This is the localscript:

local mouse = game.Players.LocalPlayer:GetMouse()
local veh = script.Parent.Parent.lb2.Value.Parent

mouse.KeyDown:connect(function(key)
    if key=="q" then
        veh.Ind:FireServer("Left")
    elseif key=="e" then
            veh.Ind:FireServer("Right")
        elseif key=="x" then
            veh.Ind:FireServer("Hazards")
        else
        end
    end)

This is the (important part) of the script:

script.Parent.Ind.OnServerEvent:connect(function(plr, Type)
    print("work")
    if Type=="Left" then
        if tickleft==false then
            veh.VehicleSeat.Toggle:Play()
            tickleft=true
            tickright=false
            hazards=false
            tickingleft()
        else
            tickleft=false
        end
    elseif Type=="Right" then
        if tickright==false then
            veh.VehicleSeat.Toggle:Play()
            tickright=true
            tickleft=false
            hazards=false
            tickingright()
        else
            tickright=false
        end
        elseif Type=="Hazards" then
            if hazards==false then
            hazards=true
            tickleft=false
            tickright=false
            hazardsticking()
        else
            hazards=false
    end
        end
        end)
0
where's the serverscript located Imperialy 149 — 5y
0
Solved it, was a stupid issue in the earlier bits of my code. Zeluxis 100 — 5y

Answer this question