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 | ||
146 | ||
147 | local num = 0 | |
148 | local p = game.Players.LocalPlayer | |
149 | local char = p.Character | |
150 | local rad = math.rad | |
151 | local hum = char.Humanoid | |
152 | local LeftUpperArm = char.LeftUpperArm | |
153 | local LeftShoulder = char.LeftUpperArm.LeftShoulder | |
154 | local LeftLowerArm = char.LeftLowerArm | |
155 | local LeftElbow = char.LeftLowerArm.LeftElbow | |
156 | local LeftUpperLeg = char.LeftUpperLeg | |
157 | local LeftHip = char.LeftUpperLeg.LeftHip | |
158 | local LeftLowerLeg = char.LeftLowerLeg | |
159 | local LeftKnee = char.LeftLowerLeg.LeftKnee | |
160 | local RightUpperArm = char.RightUpperArm | |
161 | local RightShoulder = char.RightUpperArm.RightShoulder | |
162 | local RightLowerArm = char.RightLowerArm | |
163 | local RightElbow = char.RightLowerArm.RightElbow | |
164 | local RightUpperLeg = char.RightUpperLeg | |
165 | local RightHip = char.RightUpperLeg.RightHip | |
166 | local RightLowerLeg = char.RightLowerLeg | |
167 | local RightKnee = char.RightLowerLeg.RightKnee | |
168 | local UpperTorso = char.UpperTorso | |
169 | local LowerTorso = char.LowerTorso | |
170 | local Root = char.LowerTorso.Root | |
171 | local Head = char.Head | |
172 | local Neck = char.Head.Neck | |
173 | local RootPart = char.HumanoidRootPart | |
174 | local LeftHand = char.LeftHand | |
175 | local RightHand = char.RightHand | |
176 | local LeftFoot = char.LeftFoot | |
177 | local RightFoot = char.RightFoot | |
178 | Instance.new("ForceField", char).Visible = false | |
179 | hum:SetStateEnabled("Dead", false) | |
180 | hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false) | |
181 | local candie = false | |
182 | local Udyne = true | |
183 | local v3 = Vector3.new | |
184 | local idle = true | |
185 | local walk = true | |
186 | local debounce = true | |
187 | local mouse = p:GetMouse() | |
188 | local walk1 = true | |
189 | local walkon = true | |
190 | local ns = NumberSequence.new | |
191 | local new = Instance.new | |
192 | local nr = NumberRange.new | |
193 | local bc = BrickColor.new | |
194 | local UpperTorso = char.UpperTorso | |
195 | local Waist = char.UpperTorso.Waist | |
196 | local srot = 0 | |
197 | local spos = { | |
198 | [1] = {180}, | |
199 | [2] = {144}, | |
200 | [3] = {108}, | |
201 | [4] = {72}, | |
202 | [5] = {36}, | |
203 | [6] = {0} | |
204 | } | |
205 | local Vetrom = new("Sound", char) | |
206 | Vetrom.SoundId = "rbxassetid://682726290" | |
207 | Vetrom.Volume = 5 | |
208 | Vetrom.Pitch = 1 | |
209 | Vetrom.Looped = true | |
210 | Vetrom:Play() | |
211 | local hitsnd = new("Sound", char) | |
212 | hitsnd.SoundId = "rbxassetid://410625063" | |
213 | hitsnd.Volume = 10 | |
214 | hitsnd.Pitch = 1 | |
215 | for i = 1, 20 do | |
216 | LeftShoulder.C0 = LeftShoulder.C0:lerp(CFrame.new(LeftShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
217 | RightShoulder.C0 = RightShoulder.C0:lerp(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(rad(120), rad(0), rad(0)), 0.1) | |
218 | LeftElbow.C0 = LeftElbow.C0:lerp(CFrame.new(LeftElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
219 | RightElbow.C0 = RightElbow.C0:lerp(CFrame.new(RightElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
220 | LeftHip.C0 = LeftHip.C0:lerp(CFrame.new(LeftHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
221 | RightHip.C0 = RightHip.C0:lerp(CFrame.new(RightHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
222 | LeftKnee.C0 = LeftKnee.C0:lerp(CFrame.new(LeftKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
223 | RightKnee.C0 = RightKnee.C0:lerp(CFrame.new(RightKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
224 | Root.C0 = Root.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
225 | Neck.C0 = Neck.C0:lerp(CFrame.new(Neck.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
226 | RightFoot.RightAnkle.C0 = RightFoot.RightAnkle.C0:lerp(CFrame.new(RightFoot.RightAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
227 | LeftFoot.LeftAnkle.C0 = LeftFoot.LeftAnkle.C0:lerp(CFrame.new(LeftFoot.LeftAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
228 | RightHand.RightWrist.C0 = RightHand.RightWrist.C0:lerp(CFrame.new(RightHand.RightWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
229 | LeftHand.LeftWrist.C0 = LeftHand.LeftWrist.C0:lerp(CFrame.new(LeftHand.LeftWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
230 | Waist.C0 = Waist.C0:lerp(CFrame.new(Waist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
231 | wait() | |
232 | end | |
233 | wait(0.5) | |
234 | for i = 1, 20 do | |
235 | LeftShoulder.C0 = LeftShoulder.C0:lerp(CFrame.new(LeftShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
236 | RightShoulder.C0 = RightShoulder.C0:lerp(CFrame.new(RightShoulder.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
237 | LeftElbow.C0 = LeftElbow.C0:lerp(CFrame.new(LeftElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
238 | RightElbow.C0 = RightElbow.C0:lerp(CFrame.new(RightElbow.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
239 | LeftHip.C0 = LeftHip.C0:lerp(CFrame.new(LeftHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
240 | RightHip.C0 = RightHip.C0:lerp(CFrame.new(RightHip.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
241 | LeftKnee.C0 = LeftKnee.C0:lerp(CFrame.new(LeftKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
242 | RightKnee.C0 = RightKnee.C0:lerp(CFrame.new(RightKnee.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
243 | Root.C0 = Root.C0:lerp(CFrame.new(0, 0, 0) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
244 | Neck.C0 = Neck.C0:lerp(CFrame.new(Neck.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
245 | RightFoot.RightAnkle.C0 = RightFoot.RightAnkle.C0:lerp(CFrame.new(RightFoot.RightAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
246 | LeftFoot.LeftAnkle.C0 = LeftFoot.LeftAnkle.C0:lerp(CFrame.new(LeftFoot.LeftAnkle.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
247 | RightHand.RightWrist.C0 = RightHand.RightWrist.C0:lerp(CFrame.new(RightHand.RightWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
248 | LeftHand.LeftWrist.C0 = LeftHand.LeftWrist.C0:lerp(CFrame.new(LeftHand.LeftWrist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
249 | Waist.C0 = Waist.C0:lerp(CFrame.new(Waist.C0.p) * CFrame.Angles(rad(0), rad(0), rad(0)), 0.1) | |
250 | wait() | |
251 | end | |
252 | local udynespear1 = new("Part", char) | |
253 | udynespear1.BrickColor = bc("Toothpaste") | |
254 | udynespear1.Material = "Neon" | |
255 | udynespear1.CanCollide = false | |
256 | udynespear1.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 10, 0) | |
257 | udynespear1.Size = Vector3.new(1, 1, 1) | |
258 | local udynespear2 = new("Part", char) | |
259 | udynespear2.BrickColor = udynespear1.BrickColor | |
260 | udynespear2.Material = udynespear1.Material | |
261 | udynespear2.CanCollide = false | |
262 | udynespear2.CFrame = udynespear1.CFrame | |
263 | udynespear2.Size = udynespear1.Size | |
264 | local udynespear3 = new("Part", char) | |
265 | udynespear3.BrickColor = udynespear1.BrickColor | |
266 | udynespear3.Material = udynespear1.Material | |
267 | udynespear3.CanCollide = false | |
268 | udynespear3.CFrame = udynespear1.CFrame | |
269 | udynespear3.Size = udynespear1.Size | |
270 | local udynespear4 = new("Part", char) | |
271 | udynespear4.BrickColor = udynespear1.BrickColor | |
272 | udynespear4.Material = udynespear1.Material | |
273 | udynespear4.CanCollide = false | |
274 | udynespear4.CFrame = udynespear1.CFrame | |
275 | udynespear4.Size = udynespear1.Size | |
276 | local udynespear5 = new("Part", char) | |
277 | udynespear5.BrickColor = udynespear1.BrickColor | |
278 | udynespear5.Material = udynespear1.Material | |
279 | udynespear5.CanCollide = false | |
280 | udynespear5.CFrame = udynespear1.CFrame | |
281 | udynespear5.Size = udynespear1.Size | |
282 | local udynespear6 = new("Part", char) | |
283 | udynespear6.BrickColor = udynespear1.BrickColor | |
284 | udynespear6.Material = udynespear1.Material | |
285 | udynespear6.CanCollide = false | |
286 | udynespear6.CFrame = udynespear1.CFrame | |
287 | udynespear6.Size = udynespear1.Size | |
288 | local zxc = Instance.new("SpecialMesh", udynespear1) | |
289 | zxc.MeshType = "FileMesh" | |
290 | zxc.Scale = Vector3.new(3, 3, 3) | |
291 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
292 | local zxc = Instance.new("SpecialMesh", udynespear2) | |
293 | zxc.MeshType = "FileMesh" | |
294 | zxc.Scale = Vector3.new(3, 3, 3) | |
295 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
296 | local zxc = Instance.new("SpecialMesh", udynespear3) | |
297 | zxc.MeshType = "FileMesh" | |
298 | zxc.Scale = Vector3.new(3, 3, 3) | |
299 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
300 | local zxc = Instance.new("SpecialMesh", udynespear4) | |
301 | zxc.MeshType = "FileMesh" | |
302 | zxc.Scale = Vector3.new(3, 3, 3) | |
303 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
304 | local zxc = Instance.new("SpecialMesh", udynespear5) | |
305 | zxc.MeshType = "FileMesh" | |
306 | zxc.Scale = Vector3.new(3, 3, 3) | |
307 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
308 | local zxc = Instance.new("SpecialMesh", udynespear6) | |
309 | zxc.MeshType = "FileMesh" | |
310 | zxc.Scale = Vector3.new(3, 3, 3) | |
311 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
312 | local sbg6 = Instance.new("BodyGyro", udynespear6) | |
313 | sbg6.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
314 | sbg6.D = 400 | |
315 | BP6 = Instance.new("BodyPosition", udynespear6) | |
316 | local sbg5 = Instance.new("BodyGyro", udynespear5) | |
317 | sbg5.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
318 | sbg5.D = 400 | |
319 | BP5 = Instance.new("BodyPosition", udynespear5) | |
320 | local sbg4 = Instance.new("BodyGyro", udynespear4) | |
321 | sbg4.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
322 | sbg4.D = 400 | |
323 | BP4 = Instance.new("BodyPosition", udynespear4) | |
324 | local sbg3 = Instance.new("BodyGyro", udynespear3) | |
325 | sbg3.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
326 | sbg3.D = 400 | |
327 | BP3 = Instance.new("BodyPosition", udynespear3) | |
328 | local sbg2 = Instance.new("BodyGyro", udynespear2) | |
329 | sbg2.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
330 | sbg2.D = 400 | |
331 | BP2 = Instance.new("BodyPosition", udynespear2) | |
332 | local sbg = Instance.new("BodyGyro", udynespear1) | |
333 | sbg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
334 | sbg.D = 400 | |
335 | BP = Instance.new("BodyPosition", udynespear1) | |
336 | spawn(function() | |
337 | while Udyne == true do | |
338 | BP2.Position = char.HumanoidRootPart.CFrame * CFrame.new(10, 5, 0).p | |
339 | BP3.Position = char.HumanoidRootPart.CFrame * CFrame.new(6, 8, 0).p | |
340 | BP.Position = char.HumanoidRootPart.CFrame * CFrame.new(3, 10, 0).p | |
341 | BP4.Position = char.HumanoidRootPart.CFrame * CFrame.new(-6, 8, 0).p | |
342 | BP5.Position = char.HumanoidRootPart.CFrame * CFrame.new(-3, 10, 0).p | |
343 | BP6.Position = char.HumanoidRootPart.CFrame * CFrame.new(-10, 5, 0).p | |
344 | sbg6.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
345 | sbg5.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
346 | sbg4.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
347 | sbg3.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
348 | sbg2.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
349 | sbg.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
350 | srot = srot + 4 | |
351 | if srot == 360 then | |
352 | srot = 0 | |
353 | end | |
354 | wait() | |
355 | end | |
356 | end) | |
357 | local Light = Instance.new("PointLight", char.HumanoidRootPart) | |
358 | Light.Color = Color3.new(0, 0, 1) | |
359 | Light.Brightness = 100 | |
360 | Light.Range = 10 | |
361 | hdebounce = true | |
362 | function throw1spear() | |
363 | coroutine.resume(coroutine.create(function() | |
364 | local udynespeart = new("Part", char) | |
365 | local zxc = Instance.new("SpecialMesh", udynespeart) | |
366 | zxc.MeshType = "FileMesh" | |
367 | zxc.Scale = Vector3.new(2, 2, 2) | |
368 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
369 | udynespeart.BrickColor = udynespear1.BrickColor | |
370 | udynespeart.Material = udynespear1.Material | |
371 | udynespeart.CanCollide = false | |
372 | udynespeart.Anchored = false | |
373 | udynespeart.Size = Vector3.new(2, 2, 2) | |
374 | udynespeart.CFrame = (char.HumanoidRootPart.CFrame + Vector3.new(math.random(1, 2), 0, 2)) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(0)), math.random(0, math.rad(0)), math.random(0, math.rad(0))) | |
375 | udynespeart.Touched:connect(function(hit) | |
376 | if hit.Parent == char then | |
377 | return | |
378 | end | |
379 | for i, v in pairs(hit.Parent:GetChildren()) do | |
380 | if v:IsA("Humanoid") and hdebounce == true then | |
381 | hdebounce = false | |
382 | v.Health = v.Health - 10 | |
383 | wait(0.9) | |
384 | hdebounce = true | |
385 | end | |
386 | end | |
387 | end) | |
388 | local sbgt = Instance.new("BodyGyro", udynespeart) | |
389 | sbgt.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
390 | sbgt.D = 400 | |
391 | sbgt.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
392 | BPt = Instance.new("BodyPosition", udynespeart) | |
393 | BPt.Position = udynespeart.CFrame * CFrame.new(0, 10, 0).p | |
394 | wait(1) | |
395 | udynespeart.Anchored = true | |
396 | wait(0.5) | |
397 | udynespeart.Anchored = false | |
398 | BPt:destroy() | |
399 | local BodyVelocity = Instance.new("BodyVelocity", udynespeart) | |
400 | BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge) | |
401 | BodyVelocity.velocity = mouse.Hit.lookVector * 200 | |
402 | for i = 1, 5 do | |
403 | sbgt.CFrame = CFrame.new(udynespeart.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
404 | wait() | |
405 | end | |
406 | sbgt:destroy() | |
407 | end)) | |
408 | end | |
409 | mouse.KeyDown:connect(function(k) | |
410 | if k == "e" then | |
411 | end | |
412 | end) | |
413 | mouse.KeyDown:connect(function(k) | |
414 | if k == "f" then | |
415 | throw1spear() | |
416 | end | |
417 | end) | |
418 | local hitt | |
419 | mouse.KeyDown:connect(function(k) | |
420 | if k == "q" and mouse.Target then | |
421 | if mouse.Target.Parent == char then | |
422 | return | |
423 | end | |
424 | if mouse.Target.Parent == game.workspace.Base then | |
425 | return | |
426 | end | |
427 | for i, v in pairs(mouse.Target.Parent:GetChildren()) do | |
428 | if v:IsA("Humanoid") then | |
429 | hitt = mouse.Target.Parent | |
430 | if debounce == true then | |
431 | debounce = false | |
432 | for i = 1, 2 do | |
433 | do | |
434 | local speara = new("Part", char) | |
435 | speara.Touched:connect(function(hit) | |
436 | if hit.Parent == char then | |
437 | return | |
438 | end | |
439 | for i, v in pairs(hit.Parent:GetChildren()) do | |
440 | if v:IsA("Humanoid") and hdebounce == true then | |
441 | hdebounce = false | |
442 | v.Health = v.Health - 10 | |
443 | wait(0.9) | |
444 | hdebounce = true | |
445 | end | |
446 | end | |
447 | end) | |
448 | local gunlight = Instance.new("SpotLight", speara) | |
449 | gunlight.Range = 40 | |
450 | gunlight.Angle = 60 | |
451 | gunlight.Face = "Top" | |
452 | gunlight.Shadows = true | |
453 | gunlight.Enabled = true | |
454 | gunlight.Color = Color3.new(0, 0, 1) | |
455 | local gunlight2 = Instance.new("SpotLight", speara) | |
456 | gunlight2.Range = 40 | |
457 | gunlight2.Angle = 60 | |
458 | gunlight2.Face = "Top" | |
459 | gunlight2.Shadows = true | |
460 | gunlight2.Enabled = true | |
461 | gunlight2.Color = Color3.new(0, 0, 1) | |
462 | speara.Size = Vector3.new(2, 2, 2) | |
463 | speara.BrickColor = bc("Toothpaste") | |
464 | local zxc = Instance.new("SpecialMesh", speara) | |
465 | zxc.MeshType = "FileMesh" | |
466 | zxc.Scale = Vector3.new(2, 2, 2) | |
467 | zxc.MeshId = "http://www.roblox.com/asset/?id=69891706" | |
468 | speara.Transparency = 0 | |
469 | speara.Anchored = false | |
470 | speara.CanCollide = false | |
471 | speara.Name = "Spear" | |
472 | speara.CFrame = (mouse.Hit + Vector3.new(math.random(-10, 10), 19, math.random(-10, 10))) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(359)), math.random(0, math.rad(359)), math.random(0, math.rad(359))) | |
473 | local sbgta = Instance.new("BodyGyro", speara) | |
474 | sbgta.MaxTorque = Vector3.new(math.huge, math.huge, math.huge) | |
475 | sbgta.D = 10 | |
476 | BPta = Instance.new("BodyPosition", speara) | |
477 | BPta.Name = "shootP" | |
478 | BPta.P = 20000 | |
479 | sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
480 | BPta.Position = speara.CFrame * CFrame.new(0, 2, 0).p | |
481 | wait(0.9) | |
482 | sbgta.D = 500 | |
483 | wait(1) | |
484 | BPta.D = 1000 | |
485 | BPta.Position = hitt.HumanoidRootPart.CFrame * CFrame.new(0, -3, 0).p | |
486 | sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0) | |
487 | debounce = true | |
488 | local gdisp = coroutine.wrap(function() | |
489 | wait(1) | |
490 | for i = 1, 9 do | |
491 | wait(0.1) | |
492 | speara.Transparency = speara.Transparency + 0.3 | |
493 | end | |
494 | speara:Destroy() | |
495 | end) | |
496 | gdisp() | |
497 | end | |
498 | end | |
499 | end | |
500 | end | |
501 | end | |
502 | end | |
503 | end) | |
504 | health = hum.Health | |
505 | hum.Changed:connect(function() | |
506 | if hum.Health < 5 and candie == false then | |
507 | candie = true | |
508 | defeated() | |
509 | end | |
510 | health = hum.Health | |
511 | end) | |
512 | p.Character.Humanoid.Died:connect(function() | |
513 | local jkl = Instance.new("Sound", Workspace) | |
514 | jkl.SoundId = "rbxassetid://427025525" | |
515 | jkl.Volume = 10 | |
516 | jkl:Play() | |
517 | for _, V in pairs(char:getChildren()) do | |
518 | if V:isA("BasePart") then | |
519 | V.Transparency = 1 | |
520 | elseif V:IsA("Accessory") and V:FindFirstChild("Handle") then | |
521 | V.Handle.Transparency = 1 | |
522 | end | |
523 | end | |
524 | char.Head.face:destroy() | |
525 | for i = 1, 50 do | |
526 | dust = Instance.new("Part") | |
527 | dust.Locked = true | |
528 | dust.Size = Vector3.new(0.1, 0.1, 0.1) | |
529 | dust.BrickColor = BrickColor.new("White") | |
530 | dust.Transparency = 0 | |
531 | dust.TopSurface = "Smooth" | |
532 | dust.BottomSurface = "Smooth" | |
533 | dust.CFrame = char.HumanoidRootPart.CFrame | |
534 | dust.CanCollide = true | |
535 | dust.Reflectance = 0.1 | |
536 | dust.Material = "Neon" | |
537 | dust.Parent = char | |
538 | dust.Anchored = false | |
539 | end | |
540 | end) |