SHOW:
|
|
- or go back to the newest paste.
1 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
2 | do | |
3 | --print("FE Compatibility code by Mokiros") | |
4 | script.Parent = Player.Character | |
5 | ||
6 | --RemoteEvent for communicating | |
7 | local Event = Instance.new("RemoteEvent") | |
8 | Event.Name = "UserInput_Event" | |
9 | ||
10 | --Fake event to make stuff like Mouse.KeyDown work | |
11 | local function fakeEvent() | |
12 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
13 | t.connect = t.Connect | |
14 | return t | |
15 | end | |
16 | ||
17 | --Creating fake input objects with fake variables | |
18 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
19 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
20 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
21 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
22 | end} | |
23 | --Merged 2 functions into one by checking amount of arguments | |
24 | CAS.UnbindAction = CAS.BindAction | |
25 | ||
26 | --This function will trigger the events that have been :Connect()'ed | |
27 | local function te(self,ev,...) | |
28 | local t = m[ev] | |
29 | if t and t._fakeEvent and t.Function then | |
30 | t.Function(...) | |
31 | end | |
32 | end | |
33 | m.TrigEvent = te | |
34 | UIS.TrigEvent = te | |
35 | ||
36 | Event.OnServerEvent:Connect(function(plr,io) | |
37 | if plr~=Player then return end | |
38 | if io.isMouse then | |
39 | m.Target = io.Target | |
40 | m.Hit = io.Hit | |
41 | else | |
42 | local b = io.UserInputState == Enum.UserInputState.Begin | |
43 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
44 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
45 | end | |
46 | for _,t in pairs(CAS.Actions) do | |
47 | for _,k in pairs(t.Keys) do | |
48 | if k==io.KeyCode then | |
49 | t.Function(t.Name,io.UserInputState,io) | |
50 | end | |
51 | end | |
52 | end | |
53 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
54 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
55 | end | |
56 | end) | |
57 | Event.Parent = NLS([==[ | |
58 | local Player = game:GetService("Players").LocalPlayer | |
59 | local Event = script:WaitForChild("UserInput_Event") | |
60 | ||
61 | local UIS = game:GetService("UserInputService") | |
62 | local input = function(io,a) | |
63 | if a then return end | |
64 | --Since InputObject is a client-side instance, we create and pass table instead | |
65 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
66 | end | |
67 | UIS.InputBegan:Connect(input) | |
68 | UIS.InputEnded:Connect(input) | |
69 | ||
70 | local Mouse = Player:GetMouse() | |
71 | local h,t | |
72 | --Give the server mouse data 30 times every second, but only if the values changed | |
73 | --If player is not moving their mouse, client won't fire events | |
74 | while wait(1/30) do | |
75 | if h~=Mouse.Hit or t~=Mouse.Target then | |
76 | h,t=Mouse.Hit,Mouse.Target | |
77 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
78 | end | |
79 | end]==],Player.Character) | |
80 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
81 | end | |
82 | ||
83 | ||
84 | ||
85 | local plr = owner | |
86 | local Cha = plr.Character | |
87 | local human = Cha:FindFirstChild("Humanoid") | |
88 | local RightArm = Cha:FindFirstChild("Right Arm") | |
89 | local LeftArm = Cha:FindFirstChild("Left Arm") | |
90 | local Torso = Cha:FindFirstChild("Torso") | |
91 | local Head = Cha:FindFirstChild("Head") | |
92 | local LeftArm = Cha:FindFirstChild("Left Arm") | |
93 | ||
94 | local walkspeed = human | |
95 | walkspeed.WalkSpeed = 50 | |
96 | ||
97 | local Tank = Instance.new("SpecialMesh") | |
98 | Tank.Parent = Head | |
99 | Tank.MeshId = "rbxassetid://1490852609" | |
100 | Tank.TextureId = "rbxassetid://1490852626" | |
101 | - | Tank.Scale = Vector3.new(1, 1, 1) |
101 | + | Tank.Scale = Vector3.new(2, 2, 2) |
102 | ||
103 | local Sound = Instance.new("Sound") | |
104 | Sound.Parent = Head | |
105 | Sound.SoundId = "rbxassetid://414454387" | |
106 | Sound.Volume = 10 | |
107 | Sound.Looped = true | |
108 | Sound:Play() |