SHOW:
|
|
- or go back to the newest paste.
| 1 | -- This script has been converted to FE by iPxter | |
| 2 | ||
| 3 | - | size = 240 |
| 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 | 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 | --Jungle Generator Gifted by TheRedAngel, Regular Script! | |
| 89 | ||
| 90 | size = 1000 | |
| 91 | ||
| 92 | ||
| 93 | ||
| 94 | CA = CFrame.Angles | |
| 95 | ||
| 96 | CN = CFrame.new | |
| 97 | ||
| 98 | V3 = Vector3.new | |
| 99 | ||
| 100 | MR = math.rad | |
| 101 | ||
| 102 | MP = math.pi | |
| 103 | ||
| 104 | MRA = math.random | |
| 105 | ||
| 106 | MH = math.huge | |
| 107 | ||
| 108 | ||
| 109 | ||
| 110 | Wood = {"Brown", "Reddish brown"}
| |
| 111 | ||
| 112 | Leaves = {"Earth green", "Bright green", "Dark green", "Camo"}
| |
| 113 | ||
| 114 | LeafMeshes = {{"http://www.roblox.com/asset/?id=16659363", V3(2.05,-1.6,2.05)},
| |
| 115 | ||
| 116 | {"http://www.roblox.com/asset/?id=1091940", V3(1.2,0.6,1.2)}}
| |
| 117 | ||
| 118 | ||
| 119 | ||
| 120 | Rock = {"Medium grey", "Dark grey"}
| |
| 121 | ||
| 122 | ||
| 123 | ||
| 124 | Add = {
| |
| 125 | ||
| 126 | Mesh = function(P, Id, Id2, scale) | |
| 127 | ||
| 128 | local m = Instance.new("SpecialMesh", P)
| |
| 129 | ||
| 130 | m.Scale = scale | |
| 131 | ||
| 132 | m.MeshId = Id | |
| 133 | ||
| 134 | m.TextureId = Id2 | |
| 135 | ||
| 136 | end | |
| 137 | ||
| 138 | } | |
| 139 | ||
| 140 | ||
| 141 | ||
| 142 | function Part(P, Anch, Coll, Tran, Ref, Col, X, Y, Z) | |
| 143 | ||
| 144 | local p = Instance.new("Part")
| |
| 145 | ||
| 146 | p.TopSurface = 0 | |
| 147 | ||
| 148 | p.BottomSurface = 0 | |
| 149 | ||
| 150 | p.Transparency = Tran | |
| 151 | ||
| 152 | p.Reflectance = Ref | |
| 153 | ||
| 154 | p.CanCollide = Coll | |
| 155 | ||
| 156 | p.Anchored = Anch | |
| 157 | ||
| 158 | p.BrickColor = BrickColor.new(Col) | |
| 159 | ||
| 160 | p.formFactor = "Custom" | |
| 161 | ||
| 162 | p.Size = V3(X,Y,Z) | |
| 163 | ||
| 164 | p.Parent = P | |
| 165 | ||
| 166 | p.Locked = true | |
| 167 | ||
| 168 | p:BreakJoints() | |
| 169 | ||
| 170 | return p | |
| 171 | ||
| 172 | end | |
| 173 | ||
| 174 | ||
| 175 | ||
| 176 | Mod = Instance.new("Model",workspace)
| |
| 177 | ||
| 178 | Mod.Name = "Jungle" | |
| 179 | ||
| 180 | ||
| 181 | ||
| 182 | Models = {
| |
| 183 | ||
| 184 | function(cf, siz) | |
| 185 | ||
| 186 | local m = Instance.new("Model",Mod)
| |
| 187 | ||
| 188 | local cen = cf * CN(0, 0, -38*siz) | |
| 189 | ||
| 190 | local wo = Wood[MRA(1,#Wood)] | |
| 191 | ||
| 192 | local le = Leaves[MRA(1,#Leaves)] | |
| 193 | ||
| 194 | local last = nil | |
| 195 | ||
| 196 | for i = 0, 1, 0.2 do | |
| 197 | ||
| 198 | local p = Part(m, true, true, 0, 0, wo, 3*siz, 5.7*siz, 3*siz) | |
| 199 | ||
| 200 | Instance.new("SpecialMesh",p)
| |
| 201 | ||
| 202 | p.CFrame = cen * CA(MR(-40*i), 0, 0) * CN(0, 0, 38*siz) | |
| 203 | ||
| 204 | if wo == Wood[1] then wo = Wood[2] else wo = Wood[1] end | |
| 205 | ||
| 206 | last = p | |
| 207 | ||
| 208 | end | |
| 209 | ||
| 210 | local messa = LeafMeshes[MRA(1,#LeafMeshes)] | |
| 211 | ||
| 212 | local a = -3 | |
| 213 | ||
| 214 | if messa == LeafMeshes[1] then | |
| 215 | ||
| 216 | a = 0.4 | |
| 217 | ||
| 218 | end | |
| 219 | ||
| 220 | last.BrickColor = BrickColor.new(le) | |
| 221 | ||
| 222 | local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2) | |
| 223 | ||
| 224 | local m = Add.Mesh(p, messa[1], "", V3((messa[2].X*10)*siz,(messa[2].Y*10)*siz,(messa[2].Z*10)*siz)) | |
| 225 | ||
| 226 | p.CFrame = last.CFrame * CN(0, a*siz, 0) * CA(MP+MR(20), 0, 0) | |
| 227 | ||
| 228 | end, | |
| 229 | ||
| 230 | function(cf, siz) | |
| 231 | ||
| 232 | local m = Instance.new("Model",Mod)
| |
| 233 | ||
| 234 | local ro1, ro2 = Rock[MRA(1,#Rock)], Rock[MRA(1,#Rock)] | |
| 235 | ||
| 236 | local p = Part(m, true, true, 0, 0, ro1, 7.5*siz, 7.5*siz, 7.5*siz) | |
| 237 | ||
| 238 | p.CFrame = cf * CN(0, 1.8*siz, 4*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180))) | |
| 239 | ||
| 240 | local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1290033", "", V3(5*siz, 5*siz, 5*siz)) | |
| 241 | ||
| 242 | ||
| 243 | ||
| 244 | local p2 = Part(m, true, true, 0, 0, ro2, 5.5*siz, 5.5*siz, 5.5*siz) | |
| 245 | ||
| 246 | p2.CFrame = cf * CN(7*siz, 1.5*siz, -6*siz) * CA(MR(MRA(-180,180)), MR(MRA(-180,180)), MR(MRA(-180,180))) | |
| 247 | ||
| 248 | local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1290033", "", V3(3.8*siz, 3.8*siz, 3.8*siz)) | |
| 249 | ||
| 250 | end, | |
| 251 | ||
| 252 | function(cf, siz) | |
| 253 | ||
| 254 | local m = Instance.new("Model",Mod)
| |
| 255 | ||
| 256 | local le = Leaves[MRA(1,#Leaves)] | |
| 257 | ||
| 258 | ||
| 259 | ||
| 260 | local p = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2) | |
| 261 | ||
| 262 | p.CFrame = cf * CN(2*siz, 1.6*siz, -4*siz) * CA(0, 0, 0) | |
| 263 | ||
| 264 | local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1095708", "", V3(12*siz, 11*siz, 10*siz)) | |
| 265 | ||
| 266 | ||
| 267 | ||
| 268 | local p2 = Part(m, true, false, 0, 0, le, 0.2, 0.2, 0.2) | |
| 269 | ||
| 270 | p2.CFrame = cf * CN(-4*siz, 1.1*siz, -1*siz) * CA(0, MR(-34), 0) | |
| 271 | ||
| 272 | local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=1095708", "", V3(10*siz, 7.5*siz, 8*siz)) | |
| 273 | ||
| 274 | end, | |
| 275 | ||
| 276 | function(cf, siz) | |
| 277 | ||
| 278 | local m = Instance.new("Model",Mod)
| |
| 279 | ||
| 280 | ||
| 281 | ||
| 282 | local p = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2) | |
| 283 | ||
| 284 | p.CFrame = cf * CN(2*siz, 1.1*siz, -4*siz) * CA(0, 0, 0) | |
| 285 | ||
| 286 | local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=16659363", "http://www.roblox.com/asset/?id=16659355", V3(10*siz, 14*siz, 10*siz)) | |
| 287 | ||
| 288 | ||
| 289 | ||
| 290 | local p2 = Part(m, true, false, 0, 0, "Bright green", 0.2, 0.2, 0.2) | |
| 291 | ||
| 292 | p2.CFrame = cf * CN(-4*siz, 0.7*siz, 1*siz) * CA(MR(MRA(-15,15)), MR(MRA(-180,180)), MR(MRA(-15,15))) | |
| 293 | ||
| 294 | local ms2 = Add.Mesh(p2, "http://www.roblox.com/asset/?id=16659363", "http://www.roblox.com/asset/?id=16659355", V3(7*siz, 11*siz, 6*siz)) | |
| 295 | ||
| 296 | end, | |
| 297 | ||
| 298 | function(cf, siz) | |
| 299 | ||
| 300 | local m = Instance.new("Model",Mod)
| |
| 301 | ||
| 302 | ||
| 303 | ||
| 304 | local p = Part(m, true, true, 0, 0, "White", 1.2*siz, 6*siz, 1.2*siz) | |
| 305 | ||
| 306 | p.CFrame = cf * CN((MRA(-4*100,4*100)/100)*siz, 3.2*siz, (MRA(-4*100,4*100)/100)*siz) * CA(0, MR(MRA(-180,180)), 0) | |
| 307 | ||
| 308 | local ms = Add.Mesh(p, "http://www.roblox.com/asset/?id=1090398", "http://www.roblox.com/asset/?id=1090399", V3(3.5*siz, 5*siz, 3.5*siz)) | |
| 309 | ||
| 310 | end, | |
| 311 | ||
| 312 | function(cf, siz) | |
| 313 | ||
| 314 | local m = Instance.new("Model",Mod)
| |
| 315 | ||
| 316 | local col = Wood[MRA(1,#Wood)] | |
| 317 | ||
| 318 | local p = Part(m, true, true, 0, 0, col, 2.8*siz, 22*siz, 2.8*siz) | |
| 319 | ||
| 320 | Instance.new("SpecialMesh",p)
| |
| 321 | ||
| 322 | p.CFrame = cf * CN((MRA(-4*100,4*100)/100)*siz, 11*siz, (MRA(-4*100,4*100)/100)*siz) * CA(0, MR(MRA(-180,180)), 0) | |
| 323 | ||
| 324 | local leave = Leaves[MRA(1, #Leaves)] | |
| 325 | ||
| 326 | local mes = LeafMeshes[MRA(1, #LeafMeshes)] | |
| 327 | ||
| 328 | local a = 3 | |
| 329 | ||
| 330 | local ca = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30))) | |
| 331 | ||
| 332 | if mes == LeafMeshes[1] then | |
| 333 | ||
| 334 | a = -0.5 | |
| 335 | ||
| 336 | ca = ca * CA(MP, 0, 0) | |
| 337 | ||
| 338 | end | |
| 339 | ||
| 340 | for i = 1, MRA(1,5) do | |
| 341 | ||
| 342 | local cf2 = p.CFrame * CA(0, MR(MRA(-180,180)), 0) * CN(0, (MRA(2*100, 14*100)/100)*siz, -1.4*siz) | |
| 343 | ||
| 344 | local center = cf2 * CN(0, 0, -8*siz) * CA(0, 0, 0) | |
| 345 | ||
| 346 | local first = nil | |
| 347 | ||
| 348 | for x = 0, 45, 15 do | |
| 349 | ||
| 350 | local p2 = Part(m, true, true, 0, 0, col, 2.5*siz, 4*siz, 2.5*siz) | |
| 351 | ||
| 352 | Instance.new("SpecialMesh", p2)
| |
| 353 | ||
| 354 | p2.CFrame = center * CN(0, 0, 4*siz) * CA(MR(x), 0, 0) * CN(0, 0, 10*siz) * CA(0, 0, 0) | |
| 355 | ||
| 356 | if first == nil then first = p2 end | |
| 357 | ||
| 358 | end | |
| 359 | ||
| 360 | local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2) | |
| 361 | ||
| 362 | Add.Mesh(p3, mes[1], "", (mes[2]*7)*siz) | |
| 363 | ||
| 364 | local ca2 = CA(MR(MRA(-30, 30)), MR(MRA(-180, 180)), MR(MRA(-30, 30))) | |
| 365 | ||
| 366 | if mes == LeafMeshes[1] then | |
| 367 | ||
| 368 | ca2 = ca2 * CA(MP, 0, 0) | |
| 369 | ||
| 370 | end | |
| 371 | ||
| 372 | p3.CFrame = first.CFrame * CN(0, a*siz, 0) * ca2 | |
| 373 | ||
| 374 | end | |
| 375 | ||
| 376 | local p3 = Part(m, true, false, 0, 0, leave, 0.2, 0.2, 0.2) | |
| 377 | ||
| 378 | Add.Mesh(p3, mes[1], "", (mes[2]*9)*siz) | |
| 379 | ||
| 380 | local cn = p.CFrame * CN(0, 11*siz, 0) | |
| 381 | ||
| 382 | p3.CFrame = cn * CN(0, a*siz, 0) * ca | |
| 383 | ||
| 384 | end, | |
| 385 | ||
| 386 | } | |
| 387 | ||
| 388 | ||
| 389 | ||
| 390 | pos = CN(0, 0, 0) | |
| 391 | ||
| 392 | ||
| 393 | ||
| 394 | ||
| 395 | ||
| 396 | local base = Part(Mod, true, true, 0, 0, Leaves[MRA(1,#Leaves)], size, 1, size) | |
| 397 | ||
| 398 | base.CFrame = pos * CN(0, 1, 0) | |
| 399 | ||
| 400 | base.Material = "Grass" | |
| 401 | ||
| 402 | ||
| 403 | ||
| 404 | for x = -size/2, size/2, 20 do | |
| 405 | ||
| 406 | for z = -size/2, size/2, 20 do | |
| 407 | ||
| 408 | Models[MRA(1, #Models)](pos * CN(x+(MRA(-4*1000, 4*1000)/1000), 1.2, z+(MRA(-4*1000, 4*1000)/1000)) * CA(0, MR(MRA(-180,180)), 0), MRA(1.1*100, 2.4*100)/100) | |
| 409 | ||
| 410 | end | |
| 411 | ||
| 412 | wait(0.2) | |
| 413 | ||
| 414 | end |