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.Players.timetodie23232223 |
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 | effect.Name = "Effects" | |
7 | - | --RemoteEvent for communicating |
7 | + | |
8 | - | local Event = Instance.new("RemoteEvent") |
8 | + | |
9 | - | Event.Name = "UserInput_Event" |
9 | + | |
10 | moozik.SoundId = "rbxassetid://132024343" | |
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 | hurt.Volume = 10 | |
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 | weld.Part1 = char["Right Arm"] | |
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 | local decal3 = Instance.new("Decal",block) | |
33 | decal3.Face = "Bottom" | |
34 | - | m.TrigEvent = te |
34 | + | |
35 | - | UIS.TrigEvent = te |
35 | + | |
36 | local decal5 = Instance.new("Decal",block) | |
37 | - | Event.OnServerEvent:Connect(function(plr,io) |
37 | + | |
38 | - | if plr~=Player then return end |
38 | + | |
39 | - | if io.isMouse then |
39 | + | |
40 | - | m.Target = io.Target |
40 | + | |
41 | - | m.Hit = io.Hit |
41 | + | |
42 | - | else |
42 | + | |
43 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
43 | + | |
44 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
44 | + | |
45 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
45 | + | |
46 | - | end |
46 | + | |
47 | - | for _,t in pairs(CAS.Actions) do |
47 | + | |
48 | - | for _,k in pairs(t.Keys) do |
48 | + | |
49 | - | if k==io.KeyCode then |
49 | + | |
50 | - | t.Function(t.Name,io.UserInputState,io) |
50 | + | |
51 | - | end |
51 | + | |
52 | - | end |
52 | + | |
53 | - | end |
53 | + | |
54 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
54 | + | |
55 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
55 | + | |
56 | - | end |
56 | + | |
57 | - | end) |
57 | + | |
58 | - | Event.Parent = NLS([==[ |
58 | + | |
59 | - | local Player = game:GetService("Players").LocalPlayer |
59 | + | |
60 | - | local Event = script:WaitForChild("UserInput_Event") |
60 | + | |
61 | local weld = Instance.new("Weld",cp) | |
62 | - | local UIS = game:GetService("UserInputService") |
62 | + | |
63 | - | local input = function(io,a) |
63 | + | |
64 | - | if a then return end |
64 | + | |
65 | - | --Since InputObject is a client-side instance, we create and pass table instead |
65 | + | |
66 | - | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}) |
66 | + | |
67 | char.Torso.Velocity = char.Torso.CFrame.lookVector * -100 | |
68 | - | UIS.InputBegan:Connect(input) |
68 | + | |
69 | - | UIS.InputEnded:Connect(input) |
69 | + | |
70 | ||
71 | - | local Mouse = Player:GetMouse() |
71 | + | |
72 | - | local h,t |
72 | + | |
73 | - | --Give the server mouse data 30 times every second, but only if the values changed |
73 | + | |
74 | - | --If player is not moving their mouse, client won't fire events |
74 | + | |
75 | - | while wait(1/30) do |
75 | + | |
76 | - | if h~=Mouse.Hit or t~=Mouse.Target then |
76 | + | |
77 | - | h,t=Mouse.Hit,Mouse.Target |
77 | + | |
78 | - | Event:FireServer({isMouse=true,Target=t,Hit=h}) |
78 | + | |
79 | function changeblockdecal(whatblock , bottom,top,left,right,back,front) | |
80 | - | end]==],Player.Character) |
80 | + | |
81 | - | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS |
81 | + | |
82 | local tex2 = Instance.new("Decal",whatblock) | |
83 | tex2.Face = "Front" | |
84 | - | plr = owner |
84 | + | |
85 | tex3.Face = "Bottom" | |
86 | local tex4 = Instance.new("Decal",whatblock) | |
87 | tex4.Face = "Back" | |
88 | local tex5 = Instance.new("Decal",whatblock) | |
89 | tex5.Face = "Left" | |
90 | local tex6 = Instance.new("Decal",whatblock) | |
91 | - | print("GET OUT OF MY ROOM I'M PLAYING MINECRAFT!") |
91 | + | |
92 | - | print("By Theamazingnater, now FE!") |
92 | + | |
93 | - | print("Controls: Q to mine, E to change blocks, click to place") |
93 | + | |
94 | tex5.Texture = left | |
95 | tex6.Texture = right | |
96 | tex4.Texture = back | |
97 | tex2.Texture = front | |
98 | end | |
99 | lhand = char.Torso["Left Shoulder"]:Clone() | |
100 | rhand = char.Torso["Right Shoulder"]:Clone() | |
101 | local rhandweld = Instance.new("Weld",char) | |
102 | rhandweld.Part0 = char.Torso | |
103 | rhandweld.Part1 = char["Right Arm"] | |
104 | rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1) | |
105 | local human2 = Instance.new("Weld",char) | |
106 | human2.Part0 = char.HumanoidRootPart | |
107 | human2.Part1 = char.Torso | |
108 | human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) | |
109 | ||
110 | ||
111 | function changeblocktype(whattype) | |
112 | if whattype == "Grass" then | |
113 | changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96430265","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337") | |
114 | end | |
115 | if whattype == "Dirt" then | |
116 | changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755") | |
117 | end | |
118 | if whattype == "Cobblestone" then | |
119 | changeyourblockdecal("http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377") | |
120 | end | |
121 | if whattype == "Gold" then | |
122 | changeyourblockdecal("http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851") | |
123 | end | |
124 | if whattype == "Stone" then | |
125 | changeyourblockdecal("http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261") | |
126 | end | |
127 | if whattype == "DiamondBlock" then | |
128 | changeyourblockdecal("http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371") | |
129 | end | |
130 | if whattype == "DiamondOre" then | |
131 | changeyourblockdecal("http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647") | |
132 | end | |
133 | if whattype == "WoodenPlank" then | |
134 | changeyourblockdecal("http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036") | |
135 | end | |
136 | if whattype == "OakWood" then | |
137 | changeyourblockdecal("http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786") | |
138 | end | |
139 | if whattype == "GoldOre" then | |
140 | changeyourblockdecal("http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646") | |
141 | end | |
142 | if whattype == "Sponge" then | |
143 | changeyourblockdecal("http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383") | |
144 | end | |
145 | end | |
146 | ||
147 | changeblocktype("Grass") | |
148 | ||
149 | ||
150 | ||
151 | function playanim(whatanim,speed) | |
152 | if whatanim == "Place" then | |
153 | rhandweld.Parent = char.Torso | |
154 | for i = 0,1, speed do | |
155 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i) | |
156 | game:GetService("RunService").RenderStepped:wait() | |
157 | end | |
158 | for i = 0,1, speed do | |
159 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i) | |
160 | game:GetService("RunService").RenderStepped:wait() | |
161 | end | |
162 | end | |
163 | if whatanim == "Destroy" then | |
164 | rhandweld.Parent = char.Torso | |
165 | for i = 0,1, speed do | |
166 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i) | |
167 | game:GetService("RunService").RenderStepped:wait() | |
168 | end | |
169 | for i = 0,1, speed do | |
170 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i) | |
171 | game:GetService("RunService").RenderStepped:wait() | |
172 | end | |
173 | end | |
174 | if whatanim == "NormalPose" then | |
175 | for i = 0,1 , speed do | |
176 | rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1),i) | |
177 | game:GetService("RunService").RenderStepped:wait() | |
178 | end | |
179 | end | |
180 | end | |
181 | canuse = true | |
182 | mouse = plr:GetMouse() | |
183 | function buildblock() | |
184 | if canuse then | |
185 | canuse = false | |
186 | playanim("Place", 0.07) | |
187 | local theactualblock = Instance.new("Part") | |
188 | theactualblock:BreakJoints() | |
189 | theactualblock.Parent = workspace | |
190 | theactualblock.Transparency = 0 | |
191 | theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0) | |
192 | theactualblock.Orientation = Vector3.new(0,0,0) | |
193 | theactualblock.Size = Vector3.new(3,3,3) | |
194 | theactualblock.Anchored = true | |
195 | theactualblock.CanCollide = true | |
196 | theactualblock.Name = "BlockPlace" | |
197 | changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture) | |
198 | playanim("NormalPose", 0.3) | |
199 | canuse = true | |
200 | end | |
201 | end | |
202 | function destroyblock() | |
203 | if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then | |
204 | playanim("Destroy", 0.07) | |
205 | mouse.Target:Destroy() | |
206 | playanim("NormalPose", 0.3) | |
207 | end | |
208 | end | |
209 | local mouse1 = mouse.Button1Down:connect(function() | |
210 | buildblock() | |
211 | end) | |
212 | local mouse2 = mouse.KeyDown:connect(function(k) | |
213 | if k == "q" then | |
214 | destroyblock() | |
215 | end | |
216 | if k == "e" then | |
217 | local chance = math.random(1,11) | |
218 | if chance == 1 then | |
219 | changeblocktype("Grass") | |
220 | end | |
221 | if chance == 2 then | |
222 | changeblocktype("Dirt") | |
223 | end | |
224 | if chance == 3 then | |
225 | changeblocktype("Cobblestone") | |
226 | end | |
227 | if chance == 4 then | |
228 | changeblocktype("Gold") | |
229 | end | |
230 | if chance == 5 then | |
231 | changeblocktype("Stone") | |
232 | end | |
233 | if chance == 6 then | |
234 | changeblocktype("DiamondBlock") | |
235 | end | |
236 | if chance == 7 then | |
237 | changeblocktype("DiamondOre") | |
238 | end | |
239 | if chance == 8 then | |
240 | changeblocktype("WoodenPlank") | |
241 | end | |
242 | if chance == 9 then | |
243 | - | wait() |
243 | + | |
244 | end | |
245 | if chance == 10 then | |
246 | changeblocktype("GoldOre") | |
247 | - | wait() |
247 | + | |
248 | if chance == 11 then | |
249 | changeblocktype("Sponge") | |
250 | end | |
251 | end | |
252 | end) | |
253 | HasDied = false | |
254 | - | wait() |
254 | + | |
255 | local reddeath = function() | |
256 | for i,v in pairs(char:GetChildren()) do | |
257 | if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then | |
258 | - | wait() |
258 | + | |
259 | cp.Parent = effect | |
260 | cp.BrickColor = BrickColor.new("Really red") | |
261 | cp.Transparency = 1 | |
262 | cp.CanCollide = false | |
263 | cp.Material = Enum.Material.Neon | |
264 | - | wait() |
264 | + | |
265 | cp.face:Destroy() | |
266 | end | |
267 | if cp.Name == "Torso" then | |
268 | cp.roblox:Destroy() | |
269 | end | |
270 | if v ~= char.Head then | |
271 | cp.Size = v.Size+(Vector3.new(1,1,1)*0.2) | |
272 | else | |
273 | cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2) | |
274 | end | |
275 | local weld = Instance.new("Weld",cp) | |
276 | weld.Part0 = v | |
277 | weld.Part1 = cp | |
278 | end | |
279 | end | |
280 | end | |
281 | reddeath() | |
282 | generategui = function() | |
283 | local screen = Instance.new("ScreenGui",plr.PlayerGui) | |
284 | screen.Name = "Death(lol i was lazy to add buttons lol)" | |
285 | local text = Instance.new("TextLabel",screen) | |
286 | text.Text = "You died!" | |
287 | text.TextColor3 = Color3.new(1,1,1) | |
288 | text.Font = "Arcade" | |
289 | text.TextScaled = true | |
290 | text.Position = UDim2.new(0.381, 0,0.172, 0) | |
291 | text.Size = UDim2.new(0, 200, 0, 50) | |
292 | text.BackgroundTransparency = 1 | |
293 | local respawn = Instance.new("TextButton",screen) | |
294 | respawn.Text = "Respawn" | |
295 | respawn.TextScaled = true | |
296 | respawn.Position = UDim2.new(0.381, 0,0.561, 0) | |
297 | respawn.Size = UDim2.new(0, 200,0, 50) | |
298 | respawn.BackgroundTransparency = 1 | |
299 | respawn.TextColor3 = Color3.new(1,1,1) | |
300 | respawn.Font = "Arcade" | |
301 | respawn.MouseButton1Click:connect(function() | |
302 | Dead = false | |
303 | HasDied = false | |
304 | char.Humanoid.Health = 0 | |
305 | char.Parent = nil | |
306 | respawn.Text = "Say g/r or g/sr to respawn properly" | |
307 | end) | |
308 | end | |
309 | local BODY = {} | |
310 | LeftArm = char["Left Arm"] | |
311 | RightLeg = char["Right Leg"] | |
312 | LeftLeg = char["Left Leg"] | |
313 | for _, c in pairs(char:GetDescendants()) do | |
314 | if c:IsA("BasePart") and c.Name ~= "Handle" then | |
315 | if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then | |
316 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
317 | end | |
318 | table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency}) | |
319 | elseif c:IsA("JointInstance") then | |
320 | table.insert(BODY,{c,c.Parent,nil,nil,nil}) | |
321 | end | |
322 | end | |
323 | for e = 1, #BODY do | |
324 | if BODY[e] ~= nil then | |
325 | local STUFF = BODY[e] | |
326 | local PART = STUFF[1] | |
327 | local PARENT = STUFF[2] | |
328 | local MATERIAL = STUFF[3] | |
329 | local TRANSPARENCY = STUFF[5] | |
330 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
331 | PART.Material = MATERIAL | |
332 | PART.Transparency = TRANSPARENCY | |
333 | end | |
334 | PART.AncestryChanged:Connect(function() | |
335 | PART.Parent = PARENT | |
336 | - | end |
336 | + | |
337 | - | end |
337 | + | |
338 | end | |
339 | function refit() | |
340 | char.Parent = workspace | |
341 | for e = 1, #BODY do | |
342 | if BODY[e] ~= nil then | |
343 | local STUFF = BODY[e] | |
344 | local PART = STUFF[1] | |
345 | local PARENT = STUFF[2] | |
346 | local MATERIAL = STUFF[3] | |
347 | local TRANSPARENCY = STUFF[5] | |
348 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
349 | PART.Material = MATERIAL | |
350 | PART.Transparency = TRANSPARENCY | |
351 | end | |
352 | if PART.Parent ~= PARENT then | |
353 | char:FindFirstChildOfClass("Humanoid"):remove() | |
354 | PART.Parent = PARENT | |
355 | Humanoid = Instance.new("Humanoid",char) | |
356 | end | |
357 | end | |
358 | end | |
359 | end | |
360 | char.Humanoid.Died:connect(function() | |
361 | hurt:Play() | |
362 | refit() | |
363 | mouse1:Disconnect() | |
364 | mouse2:Disconnect() | |
365 | for i,v in pairs(effect:GetChildren()) do | |
366 | if v.ClassName == "Part" then | |
367 | v.Transparency = 0.7 | |
368 | end | |
369 | end | |
370 | workspace.CurrentCamera.CameraSubject = char.Head | |
371 | generategui() | |
372 | HasDied = true | |
373 | Dead = true | |
374 | for i = 0,1, 0.03 do | |
375 | human2.C0 = human2.C0:lerp(CFrame.new(1.99999964, -3.00000095, 0, -0.00852799695, 0.999963641, 0, -0.999963641, -0.00852799695, 0, 0, 0, 1):inverse() + Vector3.new(0,1,0),i) | |
376 | game:GetService("RunService").RenderStepped:wait() | |
377 | end | |
378 | end) | |
379 | while true do | |
380 | game:GetService("RunService").RenderStepped:wait() | |
381 | if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then | |
382 | reddamage(0.5) | |
383 | damaged = true | |
384 | wait(1) | |
385 | damaged = false | |
386 | char.Humanoid.Health = 100 | |
387 | end | |
388 | if char.Humanoid.Health < 1 and Dead and HasDied then | |
389 | refit() | |
390 | for i,v in pairs(effect:GetChildren()) do | |
391 | if v.ClassName == "Part" then | |
392 | v.Transparency = 0.7 | |
393 | end | |
394 | end | |
395 | end | |
396 | if Dead and HasDied then | |
397 | char.Humanoid.WalkSpeed = 0 | |
398 | char.Humanoid.JumpPower = 0 | |
399 | human2.Parent = char.Torso | |
400 | rhandweld.Parent = char.Torso | |
401 | end | |
402 | end |