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)

2 comments

0

where's the serverscript located

0

Solved it, was a stupid issue in the earlier bits of my code.