I have a problem with my script i made for a flying vehicle, i want that when the player get on the seat, he can use Q and E to have more movement controls but it dont work and i dont get any errors..
ps: the "--mouse" section is working.
01 | function onTouched(hit) |
02 | if hit.Parent.Humanoid ~ = nil then |
03 | local plr = hit.Parent.Name |
04 | local player = game.Players:FindFirstChild(plr) |
05 | local mouse = player:GetMouse() |
06 | local s = script.Parent.TurnSpeed/ 140 |
07 | local clickQ = false |
08 | local clickE = false |
09 | local clickM = false |
10 |
11 | -- Q and E |
12 |
13 | mouse.KeyDown:connect( function (key) |
14 | if key = = "q" then |
15 | if clickQ = = false then |
The mouse
is only accessible from a localscript, localscripts only work if they are stored in something directed towards the client.
You need to look into RemoteEvents
/ RemoteFunctions
Sorry i can't give you a more straightforward answer, but doing so would mean me remaking your whole code.