So i am trying to make a FE glitcher script, but i don't know how to make one so i copied a little bit of the script and pasted it in, what i am trying to do is if the player clicks leftclick then it does a action and then prints what action you did, but i am trying to get the player's mouse but i keep getting the error "attempt to index nil with GetMouse". I am using a script, because it is going to be a serverside script. here is my code:
local CMouse = require(script.CMouse) while CMouse:GetPlayer() == nil do game:GetService("RunService").Stepped:wait() end UserInputService = game:GetService("UserInputService") --For left mouse click and others local Player2 = game:GetService("Players").LocalPlayer local mouse = Player2:GetMouse() --Error starts here Players = game:GetService("Players") plr = CMouse:GetPlayer() --getting all of the body parts. (R6) char = plr.Character hum = char:FindFirstChildOfClass'Humanoid' local cam = game.Workspace.CurrentCamera --Getting the camera Camera = cam cam.CameraType = "Custom" t = char.Torso h = char.Head ra = char["Right Arm"] la = char["Left Arm"] rl = char["Right Leg"] ll = char["Left Leg"] tors = char.Torso lleg = char["Left Leg"] root = char.HumanoidRootPart hed = char.Head rleg = char["Right Leg"] rarm = char["Right Arm"] larm = char["Left Arm"] print(Players, plr, char, hum, cam, Camera, t, h, ra, la, rl, ll, tors, lleg, root, hed, rleg, rarm, larm, mouse) --Prints all of the stuff
What is wrong with my code and how can i fix it?
Edit: They (I) forgot CMouse was a property (existent) !