Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local obj_player = owner
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- function weld(part1,part2)
- local weld = Instance.new("WeldConstraint",part1)
- weld.Part0 = part1
- weld.Part1 = part2
- end
- local person = owner.Character
- local tool = Instance.new("Tool")
- local Handle = Instance.new("Part")
- Handle.Name = "Handle"
- tool.Name = "Gun"
- tool.Parent = owner.Character
- Handle.Size = Vector3.new(.25,1,.25)
- Handle.Parent = tool
- local delay1 = false
- local attachment = Instance.new("Attachment",Handle)
- attachment.Visible = false
- attachment.Position = Vector3.new(0,.5,-.875)
- local part = Instance.new("Part",tool)
- part.CanCollide = false
- part.Position = attachment.WorldPosition
- part.Orientation = Handle.Orientation
- part.Size = Vector3.new(.25,.25,2)
- weld(part,Handle)
- tool.Equipped:Connect(function()
- tool.Activated:Connect(function()
- if delay1==false then
- if mouse.Target==nil or mouse.Target.Parent==nil then
- else
- local taP = mouse.Target.Parent
- if game.PlaceId==843468296 then
- if mouse.Target.Parent:IsA("Accessory") then
- if mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid") then
- mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
- end
- elseif mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid") then
- mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
- end
- else
- if mouse.Target.Name=="Head" then
- game.Workspace[mouse.Target.Parent.Name]:FindFirstChild("Head"):Destroy()
- elseif mouse.Target:FindFirstChildWhichIsA("Weld") then
- if mouse.Target:FindFirstChild("FaceCenterAttachment") or mouse.Target:FindFirstChild("FaceFrontAttachment") or mouse.Target:FindFirstChild("HairAttachment") or mouse.Target:FindFirstChild("HatAttachment") then
- game.Workspace[mouse.Target.Parent.Parent.Name]:FindFirstChild("Head"):Destroy()
- else
- game.Workspace[mouse.Target.Parent.Parent.Name]:FindFirstChildWhichIsA("Humanoid"):TakeDamage(math.random(15,20))
- end
- elseif mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid") or mouse.Target.Parent:FindFirstChild("Humanoid") then
- if mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid").Health>=99999999 then
- game.Workspace[mouse.Target.Parent.Parent.Name]:FindFirstChild("Head"):Destroy()
- else
- game.Workspace[mouse.Target.Parent.Name]:FindFirstChildWhichIsA("Humanoid"):TakeDamage(math.random(15,20))
- end
- else
- end
- end
- local bu = Instance.new("Part",game.Workspace)
- bu.CanCollide = true
- bu.Position = part.Position + Vector3.new(0,.35,0)
- bu.Shape = "Cylinder"
- bu.Orientation = Handle.Orientation
- bu.Material = Enum.Material.Neon
- bu.BrickColor = BrickColor.new("New Yeller")
- bu.Size = Vector3.new(.2,.2,.25)
- local BF = Instance.new("BodyForce",bu)
- BF.Force = Vector3.new(0,.95,0)
- delay1=true
- wait(.1)
- delay1=false
- local SL = Instance.new("SurfaceLight",part)
- SL.Color = Color3.fromRGB(255, 247, 0)
- SL.Range = 4
- SL.Brightness = 100
- wait(.05)
- BF:Destroy()
- wait(1)
- SL:Destroy()
- wait(.5)
- bu.CanCollide = false
- end
- end
- end)
- mouse.KeyDown:Connect(function(key)
- if key=="q" then
- if mouse.Target==nil then
- elseif mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid") then
- if mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand==false then
- mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
- else
- mouse.Target.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = false
- end
- elseif mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid") then
- if mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand==false then
- mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = true
- else
- mouse.Target.Parent.Parent:FindFirstChildWhichIsA("Humanoid").PlatformStand = false
- end
- end
- elseif key=="e" then
- if mouse.Target.Parent:FindFirstChild("RightArm") then
- mouse.Target.Parent:FindFirstChild("RightArm"):Destroy()
- elseif mouse.Target.Parent:FindFirstChild("RightUpperArm") then
- mouse.Target.Parent:FindFirstChild("RightUpperArm"):Destroy()
- elseif mouse.Target.Parent.Parent:FindFirstChild("RightUpperArm") and mouse.Target.Parent:IsA("Accessory") then
- mouse.Target.Parent.Parent:FindFirstChild("RightUpperArm"):Destroy()
- elseif mouse.Target.Parent.Parent:FindFirstChild("RightArm") and mouse.Target.Parent:IsA("Accessory") then
- mouse.Target.Parent.Parent:FindFirstChild("RightArm"):Destroy()
- end
- end
- end)
- end)
- while true do
- person.Humanoid.Health = "inf"
- person.Humanoid.PlatformStand = false
- person.Humanoid.WalkSpeed = 25
- person.Humanoid.JumpPower = 75
- person.Humanoid.MaxHealth = "inf"
- wait(.5)
- end
- print("Left mouse button click to fire a bullet:")
- print(" -Anywhere but player = 0")
- print(" -Hits the player anywhere but head = Randomizes 15 to 20")
- print(" -Hits player's head = Insta-kill")
- print("===========================================================")
- print("Q to paralize and unparalize them (WIP)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement