SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | - | local plr = game:GetService("Players").LocalPlayer |
2 | + | |
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | - | tool.Name = "bluE" |
6 | + | do |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | ||
21 | --Creating fake input objects with fake variables | |
22 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()} | |
23 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()} | |
24 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...) | |
25 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil | |
26 | end} | |
27 | --Merged 2 functions into one by checking amount of arguments | |
28 | CAS.UnbindAction = CAS.BindAction | |
29 | ||
30 | --This function will trigger the events that have been :Connect()'ed | |
31 | local function te(self,ev,...) | |
32 | local t = m[ev] | |
33 | if t and t._fakeEvent and t.Function then | |
34 | t.Function(...) | |
35 | end | |
36 | end | |
37 | m.TrigEvent = te | |
38 | UIS.TrigEvent = te | |
39 | ||
40 | Event.OnServerEvent:Connect(function(plr,io) | |
41 | if plr~=Player then return end | |
42 | if io.isMouse then | |
43 | m.Target = io.Target | |
44 | m.Hit = io.Hit | |
45 | else | |
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 UIS = game:GetService("UserInputService") | |
66 | local input = function(io,a) | |
67 | if a then return end | |
68 | --Since InputObject is a client-side instance, we create and pass table instead | |
69 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) | |
70 | end | |
71 | UIS.InputBegan:Connect(input) | |
72 | UIS.InputEnded:Connect(input) | |
73 | ||
74 | local Mouse = Player:GetMouse() | |
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 | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS | |
85 | end | |
86 | ||
87 | ||
88 | script.Parent = workspace.CurrentCamera | |
89 | local plr = owner | |
90 | ||
91 | local tool = Instance.new("Tool",plr:WaitForChild("Backpack")) | |
92 | tool.Grip = CFrame.new(0,-0.8,-0.2) * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0)) | |
93 | tool.Name = "Heaven's Wrench" | |
94 | ||
95 | local part = Instance.new("Part",tool) | |
96 | part.Name = "Handle" | |
97 | part.Size = Vector3.new(4,6,4) | |
98 | part.TopSurface = "Smooth" | |
99 | part.BottomSurface = "Smooth" | |
100 | part.CanCollide = false | |
101 | part:BreakJoints() | |
102 | ||
103 | local mesh = Instance.new("SpecialMesh",part) | |
104 | mesh.MeshId = "rbxassetid://431003868" --mesh.MeshId = "rbxassetid://132920499" | |
105 | mesh.TextureId = "rbxassetid://430627740" --"http://www.roblox.com/asset/?id=134479421" | |
106 | mesh.Scale = Vector3.new(2,2,2) | |
107 | ||
108 | local sound = Instance.new("Sound",part) | |
109 | sound.SoundId = "rbxassetid://511340819" | |
110 | sound.Volume = 3 | |
111 | ||
112 | local sound2 = Instance.new("Sound",part) | |
113 | sound2.SoundId = "rbxassetid://280667448" | |
114 | sound2.Volume = 5 | |
115 | ||
116 | local sound3 = Instance.new("Sound",part) | |
117 | sound3.SoundId = "rbxassetid://139100774" | |
118 | sound3.Volume = 10 | |
119 | ||
120 | local sound4 = Instance.new("Sound",part) | |
121 | sound4.SoundId = "rbxassetid://258057783" | |
122 | sound4.Volume = 10 | |
123 | ||
124 | local sound5 = Instance.new("Sound",part) | |
125 | sound5.SoundId = "rbxassetid://130932305" | |
126 | sound5.Volume = 10 | |
127 | ||
128 | local sound6 = Instance.new("Sound",part) | |
129 | sound6.SoundId = "rbxassetid://906084456" | |
130 | sound6.Volume = 10 | |
131 | sound6.TimePosition = 2 | |
132 | ||
133 | function firstHum(target) | |
134 | for i,v in pairs(target:GetChildren()) do | |
135 | if v:IsA("Humanoid") then | |
136 | return v | |
137 | end | |
138 | end | |
139 | return nil | |
140 | end | |
141 | ||
142 | local slap = false | |
143 | local cd = false | |
144 | ||
145 | plr:GetMouse().Button1Down:connect(function() | |
146 | if tool.Parent == plr.Character then | |
147 | if slap == false then | |
148 | slap = true | |
149 | sound2:Play() | |
150 | local str = Instance.new("StringValue") | |
151 | str.Name = "toolanim" | |
152 | str.Value = "Slash" | |
153 | str.Parent = tool | |
154 | wait(1) | |
155 | slap = false | |
156 | end | |
157 | end | |
158 | end) | |
159 | ||
160 | part.Touched:connect(function(hit) | |
161 | if slap == true then | |
162 | if cd == false then | |
163 | if not hit:IsDescendantOf(plr.Character) then | |
164 | if hit.Parent:IsA("Model") then | |
165 | local fhum = firstHum(hit.Parent) | |
166 | if fhum then | |
167 | cd = true | |
168 | fhum.PlatformStand = true | |
169 | sound:Play() | |
170 | local con1 | |
171 | con1 = game:GetService("RunService").Heartbeat:connect(function() | |
172 | fhum.PlatformStand = true | |
173 | end) | |
174 | wait(0.1) | |
175 | local vel = Instance.new("BodyVelocity",hit) | |
176 | vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50 | |
177 | vel.MaxForce = Vector3.new(10000000,10000000,10000000) | |
178 | wait(1) | |
179 | cd = false | |
180 | vel:Destroy() | |
181 | local vel2 = Instance.new("BodyVelocity",hit) | |
182 | vel2.Velocity = Vector3.new(0,12.5,0) | |
183 | vel2.MaxForce = Vector3.new(10000000,10000000,10000000) | |
184 | local p2 = Instance.new("Part",hit) | |
185 | p2.Anchored = true | |
186 | p2.Transparency = 0.6 | |
187 | p2.CanCollide = false | |
188 | p2.Size = Vector3.new(0.2,0.2,0.2) | |
189 | p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)) | |
190 | p2.BrickColor = BrickColor.new("New Yeller") | |
191 | p2.Material = "Neon" | |
192 | local m2 = Instance.new("CylinderMesh",p2) | |
193 | m2.Scale = Vector3.new(60,10000,60) | |
194 | local scln = sound3:Clone() | |
195 | scln.Parent = hit | |
196 | scln:Play() | |
197 | local con2 | |
198 | con2 = game:GetService("RunService").Heartbeat:connect(function() | |
199 | p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)) | |
200 | end) | |
201 | wait(7) | |
202 | vel2.Velocity = Vector3.new(0,0,0) | |
203 | wait(0.5) | |
204 | scln:Stop() | |
205 | local scln3 = sound5:Clone() | |
206 | scln3.Parent = hit | |
207 | scln3:Play() | |
208 | wait(1) | |
209 | local bav = Instance.new("BodyAngularVelocity",hit) | |
210 | bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360)) | |
211 | vel2.Velocity = Vector3.new(0,-250,0) | |
212 | p2.BrickColor = BrickColor.new("Really red") | |
213 | local scln6 = sound6:Clone() | |
214 | scln6.Parent = hit | |
215 | scln6:Play() | |
216 | local continue = false | |
217 | local htc | |
218 | htc = hit.Touched:connect(function(hitp) | |
219 | if not hitp:IsDescendantOf(hit.Parent) then | |
220 | continue = true | |
221 | scln6:Stop() | |
222 | vel2:Destroy() | |
223 | con2:Disconnect() | |
224 | con1:Disconnect() | |
225 | htc:Disconnect() | |
226 | p2:Destroy() | |
227 | end | |
228 | end) | |
229 | repeat wait() until continue == true | |
230 | local ctab = {} | |
231 | for i=1,4 do | |
232 | local p = Instance.new("Part",hit) | |
233 | p.Size = Vector3.new(30,30,30) | |
234 | p.Anchored = true | |
235 | p.CanCollide = false | |
236 | p.TopSurface = "Smooth" | |
237 | p.BottomSurface = "Smooth" | |
238 | p.Color = Color3.fromRGB(255,math.random(0,255),0) | |
239 | p.CFrame = hit.CFrame | |
240 | local con | |
241 | con = game:GetService("RunService").Heartbeat:connect(function() | |
242 | p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360))) | |
243 | p.Transparency = p.Transparency + 0.01 | |
244 | if p.Transparency >= 1 then | |
245 | con:Disconnect() | |
246 | end | |
247 | end) | |
248 | table.insert(ctab,con) | |
249 | end | |
250 | Instance.new("Explosion",workspace).Position = hit.Position | |
251 | local scln2 = sound4:Clone() | |
252 | scln2.Parent = hit | |
253 | scln2:Play() | |
254 | vel2:Destroy() | |
255 | hit.Parent:BreakJoints() | |
256 | repeat wait() until not hit:IsDescendantOf(workspace) | |
257 | con2:Disconnect() | |
258 | end | |
259 | end | |
260 | end | |
261 | end | |
262 | end | |
263 | end) |