Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code by Mokiros")
- local rp = RealPlayer
- script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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 then
- for _,f in pairs(t.Functions) do
- f(...)
- end
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=rp then return end
- m.Target = io.Target
- m.Hit = io.Hit
- if not io.isMouse then
- 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 Mouse = Player:GetMouse()
- 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,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- 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)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local _rg = game
- --Metatable for fake service
- local fsmt = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then return s[k] end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end,
- __call = function(self,...)
- local s = rawget(self,"_RealService")
- if s then return s(...) end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
- return setmetatable(t,fsmt)
- end
- --Fake game object
- local g = {
- GetService = function(self,s)
- return self[s]
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- }
- rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
- g.service = g.GetService
- g.RunService = FakeService({
- RenderStepped = _rg:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- setmetatable(g,{
- __index=function(self,s)
- return _rg:GetService(s) or typeof(_rg[s])=="function"
- and function(_,...)return _rg[s](_rg,...)end or _rg[s]
- end,
- __newindex = fsmt.__newindex,
- __call = fsmt.__call
- })
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = g,g.Players.LocalPlayer
- end
- local num = 0
- local p = game.Players.LocalPlayer
- local char = p.Character
- local rad = math.rad
- local hum = char.Humanoid
- local Weld0 = Instance.new("Weld")
- Instance.new("ForceField", char).Visible = false
- hum:SetStateEnabled("Dead", false)
- local candie = false
- local Udyne = true
- local v3 = Vector3.new
- local debounce = true
- local mouse = p:GetMouse()
- local walk1 = true
- local ns = NumberSequence.new
- local new = Instance.new
- local nr = NumberRange.new
- local bc = BrickColor.new
- local srot = 0
- local spos = {
- [1] = {180},
- [2] = {144},
- [3] = {108},
- [4] = {72},
- [5] = {36},
- [6] = {0}
- }
- local Vetrom = new("Sound", char)
- Vetrom.SoundId = "rbxassetid://"
- Vetrom.Volume = 5
- Vetrom.Pitch = 1
- Vetrom.Looped = true
- Vetrom:Play()
- local hitsnd = new("Sound", char)
- hitsnd.SoundId = "rbxassetid://934916502"
- hitsnd.Volume = 10
- hitsnd.Pitch = 1
- local udynespear1 = new("Part", char)
- udynespear1.BrickColor = bc("Gold")
- udynespear1.Material = "Neon"
- udynespear1.CanCollide = false
- udynespear1.CFrame = char.HumanoidRootPart.CFrame * CFrame.new(0, 10, 0)
- udynespear1.Size = Vector3.new(0,0,0)
- local udynespear2 = new("Part", char)
- udynespear2.BrickColor = udynespear1.BrickColor
- udynespear2.Material = udynespear1.Material
- udynespear2.CanCollide = false
- udynespear2.CFrame = udynespear1.CFrame
- udynespear2.Size = udynespear1.Size
- local udynespear3 = new("Part", char)
- udynespear3.BrickColor = udynespear1.BrickColor
- udynespear3.Material = udynespear1.Material
- udynespear3.CanCollide = false
- udynespear3.CFrame = udynespear1.CFrame
- udynespear3.Size = udynespear1.Size
- local udynespear4 = new("Part", char)
- udynespear4.BrickColor = udynespear1.BrickColor
- udynespear4.Material = udynespear1.Material
- udynespear4.CanCollide = false
- udynespear4.CFrame = udynespear1.CFrame
- udynespear4.Size = udynespear1.Size
- local udynespear5 = new("Part", char)
- udynespear5.BrickColor = udynespear1.BrickColor
- udynespear5.Material = udynespear1.Material
- udynespear5.CanCollide = false
- udynespear5.CFrame = udynespear1.CFrame
- udynespear5.Size = udynespear1.Size
- local udynespear6 = new("Part", char)
- udynespear6.BrickColor = udynespear1.BrickColor
- udynespear6.Material = udynespear1.Material
- udynespear6.CanCollide = false
- udynespear6.CFrame = udynespear1.CFrame
- udynespear6.Size = udynespear1.Size
- local sbg6 = Instance.new("BodyGyro", udynespear6)
- sbg6.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg6.D = 400
- BP6 = Instance.new("BodyPosition", udynespear6)
- local sbg5 = Instance.new("BodyGyro", udynespear5)
- sbg5.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg5.D = 400
- BP5 = Instance.new("BodyPosition", udynespear5)
- local sbg4 = Instance.new("BodyGyro", udynespear4)
- sbg4.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg4.D = 400
- BP4 = Instance.new("BodyPosition", udynespear4)
- local sbg3 = Instance.new("BodyGyro", udynespear3)
- sbg3.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg3.D = 400
- BP3 = Instance.new("BodyPosition", udynespear3)
- local sbg2 = Instance.new("BodyGyro", udynespear2)
- sbg2.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg2.D = 400
- BP2 = Instance.new("BodyPosition", udynespear2)
- local sbg = Instance.new("BodyGyro", udynespear1)
- sbg.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbg.D = 400
- BP = Instance.new("BodyPosition", udynespear1)
- spawn(function()
- while Udyne == true do
- sbg6.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg5.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg4.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg3.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg2.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- sbg.CFrame = CFrame.new(udynespear2.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- srot = srot + 4
- if srot == 360 then
- srot = 0
- end
- wait()
- end
- end)
- local Light = Instance.new("PointLight", char.HumanoidRootPart)
- Light.Color = Color3.new(50, 1, 0)
- Light.Brightness = 100
- Light.Range = 10
- hdebounce = true
- function throw1spear()
- coroutine.resume(coroutine.create(function()
- local udynespeart = new("Part", char)
- local zxc = Instance.new("SpecialMesh", udynespeart
- )
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(.1,.1,.1)
- zxc.MeshId = "rbxassetid://466293216"
- zxc.TextureId = "rbxassetid://466293242"
- udynespeart.BrickColor = udynespear1.BrickColor
- udynespeart.Material = udynespear1.Material
- udynespeart.CanCollide = true
- udynespeart.Anchored = false
- udynespeart.Size = Vector3.new(1.065, 4.969, 0.167)
- udynespeart.CFrame = (char.HumanoidRootPart.CFrame + Vector3.new(math.random(1, 2), 0, 2)) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(0)), math.random(0, math.rad(0)), math.random(0, math.rad(0)))
- udynespeart.Touched:connect(function(hit)
- if hit.Parent == char then
- return
- end
- for i, v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") and hdebounce == true then
- hdebounce = false
- v.Health = 0
- udynespeart.Anchored = true
- hdebounce = true
- end
- end
- end)
- local sbgt = Instance.new("BodyGyro", udynespeart)
- sbgt.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbgt.D = 400
- sbgt.CFrame = CFrame.new(udynespear3.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- BPt = Instance.new("BodyPosition", udynespeart)
- BPt.Position = udynespeart.CFrame * CFrame.new(0, 10, 0).p
- wait(1)
- udynespeart.Anchored = true
- wait(0.5)
- udynespeart.Anchored = false
- BPt:destroy()
- local BodyVelocity = Instance.new("BodyVelocity", udynespeart)
- BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- BodyVelocity.velocity = mouse.Hit.lookVector * 200
- for i = 1, 5 do
- sbgt.CFrame = CFrame.new(udynespeart.Position, mouse.Hit.p) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- wait()
- end
- sbgt:destroy()
- end))
- end
- mouse.KeyDown:connect(function(k)
- if k == "e" then
- end
- end)
- z = Instance.new("Sound", char)
- z.SoundId = "rbxassetid://168474998" -- Put Music ID Here.
- z.Looped = true
- z.Volume = 2
- wait(.1)
- z:Play()
- mouse.KeyDown:connect(function(k)
- if k == "f" then
- throw1spear()
- end
- end)
- local hitt
- mouse.KeyDown:connect(function(k)
- if k == "q" and mouse.Target then
- if mouse.Target.Parent == char then
- return
- end
- if mouse.Target.Parent == game.workspace.Base then
- return
- end
- for i, v in pairs(mouse.Target.Parent:GetChildren()) do
- if v:IsA("Humanoid") then
- hitt = mouse.Target.Parent
- if debounce == true then
- debounce = false
- for i = 1, 2 do
- do
- local speara = new("Part", char)
- speara.Touched:connect(function(hit)
- if hit.Parent == char then
- return
- end
- for i, v in pairs(hit.Parent:GetChildren()) do
- if v:IsA("Humanoid") and hdebounce == true then
- hdebounce = false
- v.Health = v.Health - 10
- wait(0.9)
- hdebounce = true
- end
- end
- end)
- local gunlight = Instance.new("SpotLight", speara)
- gunlight.Range = 40
- gunlight.Angle = 60
- gunlight.Face = "Top"
- gunlight.Shadows = true
- gunlight.Enabled = true
- gunlight.Color = Color3.new(0, 0, 1)
- local gunlight2 = Instance.new("SpotLight", speara)
- gunlight2.Range = 40
- gunlight2.Angle = 60
- gunlight2.Face = "Top"
- gunlight2.Shadows = true
- gunlight2.Enabled = true
- gunlight2.Color = Color3.new(0, 0, 1)
- speara.Size = Vector3.new(2, 2, 2)
- speara.BrickColor = bc("Toothpaste")
- local zxc = Instance.new("SpecialMesh", speara)
- zxc.MeshType = "FileMesh"
- zxc.Scale = Vector3.new(2, 2, 2)
- zxc.MeshId = "http://www.roblox.com/asset/?id=69891706"
- speara.Transparency = 0
- speara.Anchored = false
- speara.CanCollide = false
- speara.Name = "Spear"
- speara.CFrame = (mouse.Hit + Vector3.new(math.random(-10, 10), 19, math.random(-10, 10))) * CFrame.fromEulerAnglesXYZ(math.random(0, math.rad(359)), math.random(0, math.rad(359)), math.random(0, math.rad(359)))
- local sbgta = Instance.new("BodyGyro", speara)
- sbgta.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- sbgta.D = 10
- BPta = Instance.new("BodyPosition", speara)
- BPta.Name = "shootP"
- BPta.P = 20000
- sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- BPta.Position = speara.CFrame * CFrame.new(0, 2, 0).p
- wait(0.9)
- sbgta.D = 500
- wait(1)
- BPta.D = 1000
- BPta.Position = hitt.HumanoidRootPart.CFrame * CFrame.new(0, -3, 0).p
- sbgta.CFrame = CFrame.new(speara.Position, hitt.HumanoidRootPart.Position) * CFrame.Angles(-math.pi / 2, math.rad(srot), 0)
- debounce = true
- local gdisp = coroutine.wrap(function()
- wait(1)
- for i = 1, 9 do
- wait(0.1)
- speara.Transparency = speara.Transparency + 0.3
- end
- speara:Destroy()
- end)
- gdisp()
- end
- end
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement