SHOW:
|
|
- or go back to the newest paste.
| 1 | - | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
|
| 1 | + | plr = game:GetService("Players").plytalent
|
| 2 | - | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
| 2 | + | |
| 3 | - | do |
| 3 | + | |
| 4 | - | print("FE Compatibility code by Mokiros")
|
| 4 | + | |
| 5 | - | script.Parent = Player.Character |
| 5 | + | |
| 6 | - | |
| 6 | + | |
| 7 | - | --RemoteEvent for communicating |
| 7 | + | |
| 8 | - | local Event = Instance.new("RemoteEvent")
|
| 8 | + | |
| 9 | - | Event.Name = "UserInput_Event" |
| 9 | + | |
| 10 | - | |
| 10 | + | |
| 11 | - | --Fake event to make stuff like Mouse.KeyDown work |
| 11 | + | |
| 12 | - | local function fakeEvent() |
| 12 | + | |
| 13 | - | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
|
| 13 | + | |
| 14 | - | t.connect = t.Connect |
| 14 | + | |
| 15 | - | return t |
| 15 | + | |
| 16 | - | end |
| 16 | + | |
| 17 | - | |
| 17 | + | |
| 18 | - | --Creating fake input objects with fake variables |
| 18 | + | |
| 19 | - | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
|
| 19 | + | |
| 20 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
|
| 20 | + | |
| 21 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
|
| 21 | + | |
| 22 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
|
| 22 | + | |
| 23 | - | end} |
| 23 | + | |
| 24 | - | --Merged 2 functions into one by checking amount of arguments |
| 24 | + | |
| 25 | - | CAS.UnbindAction = CAS.BindAction |
| 25 | + | |
| 26 | - | |
| 26 | + | |
| 27 | - | --This function will trigger the events that have been :Connect()'ed |
| 27 | + | |
| 28 | - | local function te(self,ev,...) |
| 28 | + | |
| 29 | - | local t = m[ev] |
| 29 | + | |
| 30 | - | if t and t._fakeEvent and t.Function then |
| 30 | + | |
| 31 | - | t.Function(...) |
| 31 | + | |
| 32 | - | end |
| 32 | + | |
| 33 | - | end |
| 33 | + | |
| 34 | - | m.TrigEvent = te |
| 34 | + | |
| 35 | - | UIS.TrigEvent = te |
| 35 | + | |
| 36 | - | |
| 36 | + | repeat |
| 37 | - | Event.OnServerEvent:Connect(function(plr,io) |
| 37 | + | wait(0.5) |
| 38 | - | if plr~=Player then return end |
| 38 | + | char:FindFirstChildOfClass("Accessory"):Destroy()
|
| 39 | - | if io.isMouse then |
| 39 | + | until char:FindFirstChildOfClass("Accessory") == nil
|
| 40 | - | m.Target = io.Target |
| 40 | + | HSHair = IT("Model")
|
| 41 | - | m.Hit = io.Hit |
| 41 | + | HSHair.Parent = char |
| 42 | - | else |
| 42 | + | HSHair.Name = "HSHair" |
| 43 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
| 43 | + | RHe = IT("Part")
|
| 44 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
| 44 | + | RHe.Parent = HSHair |
| 45 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
| 45 | + | RHe.BrickColor = BrickColor.new("Really red")
|
| 46 | - | end |
| 46 | + | RHe.Locked = true |
| 47 | - | for _,t in pairs(CAS.Actions) do |
| 47 | + | RHe.CanCollide = false |
| 48 | - | for _,k in pairs(t.Keys) do |
| 48 | + | RHe.Transparency = 0 |
| 49 | - | if k==io.KeyCode then |
| 49 | + | PMesh = IT("SpecialMesh")
|
| 50 | - | t.Function(t.Name,io.UserInputState,io) |
| 50 | + | RHe.formFactor = "Symmetric" |
| 51 | - | end |
| 51 | + | PMesh.MeshType = "FileMesh" |
| 52 | - | end |
| 52 | + | PMesh.MeshId = "rbxassetid://731023666" |
| 53 | - | end |
| 53 | + | PMesh.Scale = Vector3.new(0.200000003, 0.200000003, 0.170000002) |
| 54 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
| 54 | + | PMesh.Parent = RHe |
| 55 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
| 55 | + | local RWeld = IT("Weld")
|
| 56 | - | end |
| 56 | + | RWeld.Parent = RHe |
| 57 | - | end) |
| 57 | + | RWeld.Part0 = RHe |
| 58 | - | Event.Parent = NLS([==[ |
| 58 | + | RWeld.Part1 = hed |
| 59 | - | local Player = game:GetService("Players").LocalPlayer
|
| 59 | + | RWeld.C0 = CF(0, 2.5, 1) * angles(0, Rad(180), 0) |