Here is the script I have,now the problem is the moment the plane takes off if I click on the parts which worked before,nothing happens and I get the an error:
23:41:15.340 Players.KingAviationerDev.PlayerGui.PlaneSystem.LocalScript:12: attempt to index nil with 'FindFirstChild' - Client - LocalScript:12
which links to the script bellow(aka the main script), any help is appreciated
local mouse = game.Players.LocalPlayer:GetMouse()
local UserInputService = game:GetService("UserInputService")
mouse.Button1Down:connect(function()
if mouse.Target:FindFirstChild("Clickabale") then
mouse.Target.Clickabale.RemoteEvent.Value:FireServer()
print("clicked")
end
end)
mouse.Button2Down:connect(function()
if mouse.Target:FindFirstChild("Clickabale") then
mouse.Target.Clickabale.RemoteEvent2.Value:FireServer()
print("clicked")
end
end)
mouse.Button1Down:connect(function()
if mouse.Target:FindFirstChild("button") then
print("clicked")
mouse.Target.button.RemoteEvent.Value:FireServer()
end
end)
no It works until it takes off,also if I change FindFirstchild to waitforchild it gives this error Infinite yield possible on 'Workspace.SKYtech Planekit.Planekit.Animation.AltText:WaitForChild("Clickabale")' - Studio
hierarchy of the remotevents? I dont know I just have them in ReplicatedStorage,but its not a problem with them,if it worked after the plane took off I would get “clicked” message in output
Also also if I insert a normal click detector into any part after the plane takes off it too stops even being detected by the mouse being over the part which has it