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 | |
2 | local Player,game,owner = owner,game | |
3 | local RealPlayer = Player | |
4 | do | |
5 | print("FE Compatibility code by Mokiros") | |
6 | local rp = RealPlayer | |
7 | script.Parent = rp.Character | |
8 | ||
9 | --RemoteEvent for communicating | |
10 | local Event = Instance.new("RemoteEvent") | |
11 | Event.Name = "UserInput_Event" | |
12 | ||
13 | --Fake event to make stuff like Mouse.KeyDown work | |
14 | local function fakeEvent() | |
15 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end} | |
16 | t.connect = t.Connect | |
17 | return t | |
18 | end | |
19 | ||
20 | --Creating fake input objects with fake variables | |
21 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
22 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
23 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
24 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
25 | end} | |
26 | --Merged 2 functions into one by checking amount of arguments | |
27 | CAS.UnbindAction = CAS.BindAction | |
28 | ||
29 | --This function will trigger the events that have been :Connect()'ed | |
30 | local function te(self,ev,...) | |
31 | local t = m[ev] | |
32 | if t and t._fakeEvent then | |
33 | for _,f in pairs(t.Functions) do | |
34 | f(...) | |
35 | end | |
36 | end | |
37 | end | |
38 | m.TrigEvent = te | |
39 | UIS.TrigEvent = te | |
40 | ||
41 | Event.OnServerEvent:Connect(function(plr,io) | |
42 | if plr~=rp then return end | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | if not io.isMouse then | |
46 | local b = io.UserInputState == Enum.UserInputState.Begin | |
47 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
48 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
49 | end | |
50 | for _,t in pairs(CAS.Actions) do | |
51 | for _,k in pairs(t.Keys) do | |
52 | if k==io.KeyCode then | |
53 | t.Function(t.Name,io.UserInputState,io) | |
54 | end | |
55 | end | |
56 | end | |
57 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
58 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
59 | end | |
60 | end) | |
61 | Event.Parent = NLS([==[ | |
62 | local Player = game:GetService("Players").LocalPlayer | |
63 | local Event = script:WaitForChild("UserInput_Event") | |
64 | ||
65 | local Mouse = Player:GetMouse() | |
66 | local UIS = game:GetService("UserInputService") | |
67 | local input = function(io,a) | |
68 | if a then return end | |
69 | --Since InputObject is a client-side instance, we create and pass table instead | |
70 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target}) | |
71 | end | |
72 | UIS.InputBegan:Connect(input) | |
73 | UIS.InputEnded:Connect(input) | |
74 | ||
75 | local h,t | |
76 | --Give the server mouse data 30 times every second, but only if the values changed | |
77 | --If player is not moving their mouse, client won't fire events | |
78 | while wait(1/30) do | |
79 | if h~=Mouse.Hit or t~=Mouse.Target then | |
80 | h,t=Mouse.Hit,Mouse.Target | |
81 | Event:FireServer({isMouse=true,Target=t,Hit=h}) | |
82 | end | |
83 | end]==],Player.Character) | |
84 | ||
85 | ----Sandboxed game object that allows the usage of client-side methods and services | |
86 | --Real game object | |
87 | local _rg = game | |
88 | ||
89 | --Metatable for fake service | |
90 | local fsmt = { | |
91 | __index = function(self,k) | |
92 | local s = rawget(self,"_RealService") | |
93 | if s then return s[k] end | |
94 | end, | |
95 | __newindex = function(self,k,v) | |
96 | local s = rawget(self,"_RealService") | |
97 | if s then s[k]=v end | |
98 | end, | |
99 | __call = function(self,...) | |
100 | local s = rawget(self,"_RealService") | |
101 | if s then return s(...) end | |
102 | end | |
103 | } | |
104 | local function FakeService(t,RealService) | |
105 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
106 | return setmetatable(t,fsmt) | |
107 | end | |
108 | ||
109 | --Fake game object | |
110 | local g = { | |
111 | GetService = function(self,s) | |
112 | return self[s] | |
113 | end, | |
114 | Players = FakeService({ | |
115 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player) | |
116 | },"Players"), | |
117 | UserInputService = FakeService(UIS,"UserInputService"), | |
118 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
119 | } | |
120 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
121 | g.service = g.GetService | |
122 | ||
123 | g.RunService = FakeService({ | |
124 | RenderStepped = _rg:GetService("RunService").Heartbeat, | |
125 | BindToRenderStep = function(self,name,_,fun) | |
126 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
127 | end, | |
128 | UnbindFromRenderStep = function(self,name) | |
129 | self._btrs[name]:Disconnect() | |
130 | end, | |
131 | },"RunService") | |
132 | ||
133 | setmetatable(g,{ | |
134 | __index=function(self,s) | |
135 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
136 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
137 | end, | |
138 | __newindex = fsmt.__newindex, | |
139 | __call = fsmt.__call | |
140 | }) | |
141 | --Changing owner to fake player object to support owner:GetMouse() | |
142 | game,owner = g,g.Players.LocalPlayer | |
143 | end | |
144 | ||
145 | Plrs = game:GetService("Players") | |
146 | ||
147 | - | Name = "SNEAKY_Dodge" |
147 | + | Name = "silver22352" |
148 | me = Plrs[Name] | |
149 | char = me.Character | |
150 | Modelname = "PokeSoul" | |
151 | Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"} | |
152 | necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) | |
153 | ||
154 | Add = { | |
155 | Sphere = function(P) | |
156 | local m = Instance.new("SpecialMesh",P) | |
157 | m.MeshType = "Sphere" | |
158 | return m | |
159 | end, | |
160 | BF = function(P) | |
161 | local bf = Instance.new("BodyForce",P) | |
162 | bf.force = Vector3.new(0, P:GetMass()*187, 0) | |
163 | return bf | |
164 | end, | |
165 | BP = function(P) | |
166 | local bp = Instance.new("BodyPosition",P) | |
167 | bp.maxForce = Vector3.new(math.huge, 0, math.huge) | |
168 | bp.P = 14000 | |
169 | return bp | |
170 | end, | |
171 | BG = function(P) | |
172 | local bg = Instance.new("BodyGyro",P) | |
173 | bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
174 | bg.P = 14000 | |
175 | return bg | |
176 | end | |
177 | } | |
178 | ||
179 | function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break) | |
180 | local p = Instance.new("Part") | |
181 | p.formFactor = "Custom" | |
182 | p.Anchored = Anchor | |
183 | p.CanCollide = Collide | |
184 | p.Transparency = Tran | |
185 | p.Reflectance = Ref | |
186 | p.BrickColor = BrickColor.new(Color) | |
187 | for _, Surf in pairs(Surfaces) do | |
188 | p[Surf] = "Smooth" | |
189 | end | |
190 | p.Size = Vector3.new(X, Y, Z) | |
191 | if Break then | |
192 | p:BreakJoints() | |
193 | else p:MakeJoints() end | |
194 | p.Parent = Parent | |
195 | return p | |
196 | end | |
197 | ||
198 | function Weld(p0, p1, x, y, z, a, b, c) | |
199 | local w = Instance.new("Weld") | |
200 | w.Parent = p0 | |
201 | w.Part0 = p0 | |
202 | w.Part1 = p1 | |
203 | w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c) | |
204 | return w | |
205 | end | |
206 | ||
207 | function ComputePos(pos1, pos2) | |
208 | local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z) | |
209 | return CFrame.new(pos1, pos3) | |
210 | end | |
211 | ||
212 | for i,v in pairs(char:children()) do | |
213 | if v.Name == Modelname then | |
214 | v:remove() | |
215 | end | |
216 | end | |
217 | ||
218 | torso = char.Torso | |
219 | neck = torso.Neck | |
220 | hum = char.Humanoid | |
221 | Rarm = char["Right Arm"] | |
222 | Larm = char["Left Arm"] | |
223 | Rleg = char["Right Leg"] | |
224 | Lleg = char["Left Leg"] | |
225 | ||
226 | slash = Instance.new("Sound") | |
227 | slash.SoundId = "rbxasset://sounds//swordslash.wav" | |
228 | slash.Volume = 0.8 | |
229 | slash.Pitch = 1.4 | |
230 | slash.Parent = Rarm | |
231 | ||
232 | hitsound = Instance.new("Sound") | |
233 | hitsound.SoundId = "http://www.roblox.com/asset/?id=2801263" | |
234 | hitsound.Volume = 0.55 | |
235 | hitsound.Pitch = 2.1 | |
236 | hitsound.Parent = torso | |
237 | ||
238 | Mo = Instance.new("Model") | |
239 | Mo.Name = Modelname | |
240 | ||
241 | RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
242 | LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
243 | RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
244 | LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true) | |
245 | ||
246 | RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0) | |
247 | LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0) | |
248 | RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0) | |
249 | LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0) | |
250 | ||
251 | RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0) | |
252 | LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0) | |
253 | RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0) | |
254 | LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0) | |
255 | ||
256 | for i = -100, -1, 25 do | |
257 | local p = Part(Mo, false, false, 0, 0, "Black", 0.8, 0.3, 0.1, true) | |
258 | local w = Weld(torso, p, 0, 0, 0, 0, 0, 0) | |
259 | w.C0 = CFrame.new(0, -0.5, -0.6) * CFrame.Angles(0, math.rad(i), 0) | |
260 | w.C1 = CFrame.new(0, 0, -0.6) | |
261 | end | |
262 | ||
263 | Mo.Parent = char |