SHOW:
|
|
- or go back to the newest paste.
| 1 | -- This script has convert to FE by who i don't know? | |
| 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,game,owner = owner,game | |
| 6 | local RealPlayer = Player | |
| 7 | do | |
| 8 | print("FE Compatibility code by Mokiros | Showcase by Bacon Hair!")
| |
| 9 | local rp = RealPlayer | |
| 10 | script.Parent = rp.Character | |
| 11 | ||
| 12 | --RemoteEvent for communicating | |
| 13 | local Event = Instance.new("RemoteEvent")
| |
| 14 | Event.Name = "UserInput_Event" | |
| 15 | ||
| 16 | --Fake event to make stuff like Mouse.KeyDown work | |
| 17 | local function fakeEvent() | |
| 18 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 19 | t.connect = t.Connect | |
| 20 | return t | |
| 21 | end | |
| 22 | ||
| 23 | --Creating fake input objects with fake variables | |
| 24 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 25 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 26 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 27 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 28 | end} | |
| 29 | --Merged 2 functions into one by checking amount of arguments | |
| 30 | CAS.UnbindAction = CAS.BindAction | |
| 31 | ||
| 32 | --This function will trigger the events that have been :Connect()'ed | |
| 33 | local function te(self,ev,...) | |
| 34 | local t = m[ev] | |
| 35 | if t and t._fakeEvent then | |
| 36 | for _,f in pairs(t.Functions) do | |
| 37 | f(...) | |
| 38 | end | |
| 39 | end | |
| 40 | end | |
| 41 | m.TrigEvent = te | |
| 42 | UIS.TrigEvent = te | |
| 43 | ||
| 44 | Event.OnServerEvent:Connect(function(plr,io) | |
| 45 | if plr~=rp then return end | |
| 46 | m.Target = io.Target | |
| 47 | m.Hit = io.Hit | |
| 48 | if not io.isMouse then | |
| 49 | local b = io.UserInputState == Enum.UserInputState.Begin | |
| 50 | if io.UserInputType == Enum.UserInputType.MouseButton1 then | |
| 51 | return m:TrigEvent(b and "Button1Down" or "Button1Up") | |
| 52 | end | |
| 53 | for _,t in pairs(CAS.Actions) do | |
| 54 | for _,k in pairs(t.Keys) do | |
| 55 | if k==io.KeyCode then | |
| 56 | t.Function(t.Name,io.UserInputState,io) | |
| 57 | end | |
| 58 | end | |
| 59 | end | |
| 60 | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) | |
| 61 | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) | |
| 62 | end | |
| 63 | end) | |
| 64 | Event.Parent = NLS([==[ | |
| 65 | local Player = game:GetService("Players").LocalPlayer
| |
| 66 | local Event = script:WaitForChild("UserInput_Event")
| |
| 67 | ||
| 68 | local Mouse = Player:GetMouse() | |
| 69 | local UIS = game:GetService("UserInputService")
| |
| 70 | local input = function(io,a) | |
| 71 | if a then return end | |
| 72 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 73 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 74 | end | |
| 75 | UIS.InputBegan:Connect(input) | |
| 76 | UIS.InputEnded:Connect(input) | |
| 77 | ||
| 78 | local h,t | |
| 79 | --Give the server mouse data 30 times every second, but only if the values changed | |
| 80 | --If player is not moving their mouse, client won't fire events | |
| 81 | while wait(1/30) do | |
| 82 | if h~=Mouse.Hit or t~=Mouse.Target then | |
| 83 | h,t=Mouse.Hit,Mouse.Target | |
| 84 | Event:FireServer({isMouse=true,Target=t,Hit=h})
| |
| 85 | end | |
| 86 | end]==],Player.Character) | |
| 87 | ||
| 88 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 89 | --Real game object | |
| 90 | local _rg = game | |
| 91 | ||
| 92 | --Metatable for fake service | |
| 93 | local fsmt = {
| |
| 94 | __index = function(self,k) | |
| 95 | local s = rawget(self,"_RealService") | |
| 96 | if s then return s[k] end | |
| 97 | end, | |
| 98 | __newindex = function(self,k,v) | |
| 99 | local s = rawget(self,"_RealService") | |
| 100 | if s then s[k]=v end | |
| 101 | end, | |
| 102 | __call = function(self,...) | |
| 103 | local s = rawget(self,"_RealService") | |
| 104 | if s then return s(...) end | |
| 105 | end | |
| 106 | } | |
| 107 | local function FakeService(t,RealService) | |
| 108 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 109 | return setmetatable(t,fsmt) | |
| 110 | end | |
| 111 | ||
| 112 | --Fake game object | |
| 113 | local g = {
| |
| 114 | GetService = function(self,s) | |
| 115 | return self[s] | |
| 116 | end, | |
| 117 | Players = FakeService({
| |
| 118 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 119 | },"Players"), | |
| 120 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 121 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 122 | } | |
| 123 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 124 | g.service = g.GetService | |
| 125 | ||
| 126 | g.RunService = FakeService({
| |
| 127 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 128 | BindToRenderStep = function(self,name,_,fun) | |
| 129 | ||
| 130 | end, | |
| 131 | UnbindFromRenderStep = function(self,name) | |
| 132 | self._btrs[name]:Disconnect() | |
| 133 | end, | |
| 134 | },"RunService") | |
| 135 | ||
| 136 | setmetatable(g,{
| |
| 137 | __index=function(self,s) | |
| 138 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 139 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 140 | end, | |
| 141 | __newindex = fsmt.__newindex, | |
| 142 | __call = fsmt.__call | |
| 143 | }) | |
| 144 | --Changing owner to fake player object to support owner:GetMouse() | |
| 145 | game,owner = g,g.Players.LocalPlayer | |
| 146 | end | |
| 147 | ----// Click to destroy by krit2552 Enjoy! Helper VictoriaChristophe | |
| 148 | ||
| 149 | ||
| 150 | local p = game.Players.LocalPlayer | |
| 151 | ||
| 152 | local char = p.Character | |
| 153 | ||
| 154 | local hum = char.Humanoid | |
| 155 | ||
| 156 | hum.MaxHealth = math.huge | |
| 157 | ||
| 158 | hum.Health = math.huge | |
| 159 | ||
| 160 | Instance.new("ForceField",char).Visible = false
| |
| 161 | ||
| 162 | local mouse = p:GetMouse() | |
| 163 | ||
| 164 | local soundPart | |
| 165 | ||
| 166 | ||
| 167 | ||
| 168 | ||
| 169 | local soundStart = Instance.new("Sound",char.Torso)
| |
| 170 | ||
| 171 | soundStart.Volume = 0 | |
| 172 | ||
| 173 | soundStart.SoundId = "rbxassetid://407239668" | |
| 174 | ||
| 175 | ||
| 176 | ||
| 177 | ||
| 178 | local soundRun = Instance.new("Sound",char.Torso)
| |
| 179 | ||
| 180 | soundRun.Volume = 0 | |
| 181 | ||
| 182 | soundRun.Looped = true | |
| 183 | ||
| 184 | soundRun.SoundId = "rbxassetid://407218731" | |
| 185 | ||
| 186 | ||
| 187 | ||
| 188 | ||
| 189 | ||
| 190 | ||
| 191 | ||
| 192 | local down = false | |
| 193 | ||
| 194 | ||
| 195 | ||
| 196 | ||
| 197 | function FireLaser(a, b) | |
| 198 | ||
| 199 | if (soundPart) then | |
| 200 | ||
| 201 | soundPart.CFrame = b | |
| 202 | ||
| 203 | end | |
| 204 | ||
| 205 | local a2 = Instance.new("Part", char)
| |
| 206 | ||
| 207 | local b2 = Instance.new("SpecialMesh", a2)
| |
| 208 | ||
| 209 | b2.MeshType = "Cylinder" | |
| 210 | ||
| 211 | a2.Material = "Neon" | |
| 212 | ||
| 213 | a2.TopSurface = "Smooth" | |
| 214 | ||
| 215 | a2.BottomSurface = "Smooth" | |
| 216 | ||
| 217 | a2.Anchored = true | |
| 218 | ||
| 219 | a2.CanCollide = false | |
| 220 | ||
| 221 | a2.Transparency = 1 | |
| 222 | ||
| 223 | touchCounter = 0 | |
| 224 | local cR=255 | |
| 225 | local cG=0 | |
| 226 | local cB=0 | |
| 227 | local flg5=1 local omgidk=1 | |
| 228 | local add=50 | |
| 229 | game:GetService("RunService"):BindToRenderStep("Ghost",1,function()
| |
| 230 | if omgidk>10000 then omgidk=0 end | |
| 231 | omgidk=omgidk+1 | |
| 232 | if cR>=255 then flg5=1 end | |
| 233 | if cG>=255 then flg5=2 end | |
| 234 | if cB>=255 then flg5=3 end | |
| 235 | if flg5==1 then cR=cR-add cG=cG+add end | |
| 236 | if flg5==2 then cG=cG-add cB=cB+add end | |
| 237 | if flg5==3 then cB=cB-add cR=cR+add end | |
| 238 | color=Color3.fromRGB(cR,cG,cB) | |
| 239 | a2.Color = color | |
| 240 | end) | |
| 241 | ||
| 242 | local c = Instance.new("ParticleEmitter", a2)
| |
| 243 | ||
| 244 | c.Color = ColorSequence.new(a2.BrickColor.Color, Color3.new(1, 1, 1)) | |
| 245 | ||
| 246 | c.Size = NumberSequence.new(0.1, 0.2) | |
| 247 | ||
| 248 | c.Lifetime = NumberRange.new(0.3, 0.7) | |
| 249 | ||
| 250 | c.Rate = 0 | |
| 251 | ||
| 252 | c.EmissionDirection = "Right" | |
| 253 | ||
| 254 | c.Speed = NumberRange.new(6, 12) | |
| 255 | ||
| 256 | c.VelocitySpread = 0 | |
| 257 | ||
| 258 | local function CreateRegion3FromLocAndSize(Position, Size) | |
| 259 | ||
| 260 | local SizeOffset = Size/2 | |
| 261 | ||
| 262 | local Point1 = Position - SizeOffset | |
| 263 | ||
| 264 | local Point2 = Position + SizeOffset | |
| 265 | ||
| 266 | return Region3.new(Point1, Point2) | |
| 267 | ||
| 268 | end | |
| 269 | ||
| 270 | local reg = CreateRegion3FromLocAndSize(b.p, Vector3.new(10, 10, 10)) | |
| 271 | ||
| 272 | local index = 0 | |
| 273 | ||
| 274 | local small = 1000 | |
| 275 | ||
| 276 | local purts = {}
| |
| 277 | ||
| 278 | for i, v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, char:GetChildren(), 100)) do | |
| 279 | ||
| 280 | table.insert(purts, v) | |
| 281 | ||
| 282 | end | |
| 283 | ||
| 284 | for i, v in pairs(purts) do | |
| 285 | ||
| 286 | if (b.p - v.Position).magnitude < small and v.Name ~= "Baseplate" and not v:FindFirstChild("SurfaceGui") and v.Name ~= "Base" and v ~= workspace.Terrain then
| |
| 287 | ||
| 288 | small = (b.p - v.Position).magnitude | |
| 289 | ||
| 290 | index = i | |
| 291 | ||
| 292 | end | |
| 293 | ||
| 294 | end | |
| 295 | ||
| 296 | if index ~= 0 then | |
| 297 | ||
| 298 | b = purts[index].CFrame | |
| 299 | ||
| 300 | end | |
| 301 | ||
| 302 | local dis = (a.p - b.p).magnitude | |
| 303 | ||
| 304 | a2.Size = Vector3.new(dis, 1.3, 1.3) | |
| 305 | b2.Scale = Vector3.new(0, 1.3, 1.3) | |
| 306 | ||
| 307 | a2.CFrame = CFrame.new(a.p, b.p) * CFrame.new(0, 0, -dis / 2) * CFrame.Angles(0, math.rad(90), 0) | |
| 308 | ||
| 309 | for i = 0.2, 0, -0.1 do | |
| 310 | ||
| 311 | b2.Scale = Vector3.new(1, i, i) | |
| 312 | ||
| 313 | wait() | |
| 314 | ||
| 315 | end | |
| 316 | ||
| 317 | a2:Destroy() | |
| 318 | ||
| 319 | pcall(function() purts[index]:Destroy() end) | |
| 320 | ||
| 321 | wait() | |
| 322 | ||
| 323 | --t:Destroy() | |
| 324 | ||
| 325 | end | |
| 326 | ||
| 327 | ||
| 328 | ||
| 329 | ||
| 330 | mouse.Button1Down:connect(function() | |
| 331 | ||
| 332 | down = true | |
| 333 | ||
| 334 | local t = Instance.new("Part", char)
| |
| 335 | ||
| 336 | t.Size = Vector3.new(0.2, 0.2, 0.2) | |
| 337 | ||
| 338 | t.Anchored = true | |
| 339 | ||
| 340 | t.CanCollide = false | |
| 341 | ||
| 342 | t.Transparency = 1 | |
| 343 | ||
| 344 | local s = Instance.new("Sound", t)
| |
| 345 | ||
| 346 | s.Looped = true | |
| 347 | ||
| 348 | s.SoundId = "rbxassetid://407218786" | |
| 349 | ||
| 350 | soundPart = t | |
| 351 | ||
| 352 | ||
| 353 | ||
| 354 | ||
| 355 | local c = Instance.new("ParticleEmitter", t)
| |
| 356 | ||
| 357 | c.Color = ColorSequence.new(char.Torso.BrickColor.Color, Color3.new(1, 1, 1)) | |
| 358 | ||
| 359 | c.LightEmission = 1 | |
| 360 | ||
| 361 | c.Size = NumberSequence.new(0.2, 0.3) | |
| 362 | ||
| 363 | c.Lifetime = NumberRange.new(0.3, 0.7) | |
| 364 | ||
| 365 | c.Rate = 0 | |
| 366 | ||
| 367 | c.EmissionDirection = "Back" | |
| 368 | ||
| 369 | c.Speed = NumberRange.new(5, 10) | |
| 370 | ||
| 371 | c.VelocitySpread = 0 | |
| 372 | ||
| 373 | ||
| 374 | ||
| 375 | soundStart:play() | |
| 376 | ||
| 377 | soundRun:play() | |
| 378 | ||
| 379 | end) | |
| 380 | ||
| 381 | ||
| 382 | ||
| 383 | ||
| 384 | mouse.Button1Up:connect(function() | |
| 385 | ||
| 386 | down = false | |
| 387 | ||
| 388 | if (soundPart) then | |
| 389 | ||
| 390 | soundPart.Sound:stop() | |
| 391 | ||
| 392 | soundPart:Destroy() | |
| 393 | ||
| 394 | end | |
| 395 | ||
| 396 | soundStart:stop() | |
| 397 | ||
| 398 | soundRun:stop() | |
| 399 | ||
| 400 | end) | |
| 401 | ||
| 402 | ||
| 403 | ||
| 404 | ||
| 405 | game:GetService("RunService").Heartbeat:connect(function()
| |
| 406 | ||
| 407 | if down then | |
| 408 | ||
| 409 | FireLaser(char.Torso.CFrame, mouse.Hit) | |
| 410 | ||
| 411 | end | |
| 412 | ||
| 413 | end) | |
| 414 | ||
| 415 | MRANDOM = math.random | |
| 416 | local MATHS = {"0", "1", "3", "2", "4", "5", "6", "7", "8", "9", "10"}
| |
| 417 | spawn(function() | |
| 418 | while wait() do | |
| 419 | hum.Name = MATHS[MRANDOM(1,#MATHS)].."V"..MATHS[MRANDOM(1,#MATHS)].."I"..MATHS[MRANDOM(1,#MATHS)].."C"..MATHS[MRANDOM(1,#MATHS)].."T"..MATHS[MRANDOM(1,#MATHS)].."T"..MATHS[MRANDOM(1,#MATHS)].."O"..MATHS[MRANDOM(1,#MATHS)].."R"..MATHS[MRANDOM(1,#MATHS)].."I"..MATHS[MRANDOM(1,#MATHS)].."A"..MATHS[MRANDOM(1,#MATHS)] | |
| 420 | end | |
| 421 | end) |