Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NLS([[
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local E = ReplicatedStorage:WaitForChild("ELol")
- local mouse = owner:GetMouse()
- local target
- local down
- local cursor = Instance.new("Part", owner.Character)
- cursor.Size = Vector3.new(0.1,0.1,0.1)
- cursor.Anchored = true
- cursor.Transparency = 1
- local attachment0 = Instance.new("Attachment")
- attachment0.Parent = cursor
- local attachment1 = Instance.new("Attachment")
- attachment1.Parent = cursor
- alignposition = Instance.new("AlignPosition")
- alignposition.Parent = cursor
- alignposition.Attachment0 = attachment0
- alignposition.Attachment1 = attachment1
- alignposition.RigidityEnabled = true
- attachment0.Visible = false
- mouse.Button1Down:connect(function()
- if mouse.Target ~= nil then
- target = mouse.Target
- down = true
- attachment0.Parent = target
- task.wait()
- attachment0.WorldCFrame = mouse.Hit
- attachment0.Visible = true
- task.wait()
- local Model = target:FindFirstAncestorOfClass("Model")
- if Model then
- mouse.TargetFilter = Model
- else
- mouse.TargetFilter = target
- end
- task.wait()
- E:FireServer(target, down, mouse.Hit)
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- cursor.Position = game.Workspace.CurrentCamera.CFrame.Position + (mouse.Hit.Position - game.Workspace.CurrentCamera.CFrame.Position).Unit * 20 + Vector3.new(0,0.1,0)
- end)
- mouse.Button1Up:connect(function()
- down = false
- task.wait()
- E:FireServer(target, down, mouse.Hit)
- wait()
- target = nil
- mouse.TargetFilter = nil
- attachment0.WorldCFrame = cursor.CFrame
- attachment0.Parent = cursor
- attachment0.Visible = false
- end)
- ]],owner.PlayerGui)
- local attachment0 = Instance.new("Attachment")
- attachment0.Parent = owner.Character.Head
- local attachment1 = Instance.new("Attachment")
- attachment1.Parent = owner.Character.Head
- local beam = Instance.new("Beam")
- beam.Attachment0 = attachment0
- beam.Attachment1 = attachment1
- beam.CurveSize0 = 2 -- create a curved beam
- beam.CurveSize1 = -2 -- create a curved beam
- beam.FaceCamera = true -- beam is visible from every angle
- beam.Segments = 10 -- default curve resolution
- beam.Width0 = 1 -- starts small
- beam.Width1 = 1
- beam.Enabled = false
- beam.Parent = attachment0
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local E= Instance.new("RemoteEvent", ReplicatedStorage)
- E.Name = "ELol"
- local PC
- local Model
- local who
- local oldplat
- local function where(player, target, down,hitp)
- pcall(function()
- if target.Name ~= "Base" then
- if down then
- who = target
- beam.Enabled = true
- attachment0.Parent = who
- attachment0.WorldCFrame = hitp
- Model = who:FindFirstAncestorOfClass("Model")
- if Model then
- PC = game:GetService("Players"):GetPlayerFromCharacter(Model)
- if PC then
- task.wait()
- oldplat = PC.Character.Humanoid.PlatformStand
- PC.Character.Humanoid.PlatformStand = true
- for i,v in pairs(PC.Character:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(owner)
- end)
- end
- else
- for i,v in pairs(Model:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(owner)
- end)
- end
- end
- else
- who:SetNetworkOwner(owner)
- for i,v in pairs(who:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(owner)
- end)
- end
- end
- elseif not down then
- beam.Enabled = false
- attachment0.Parent = owner.Character.Head
- task.wait()
- if PC then
- PC.Character.Humanoid.PlatformStand = oldplat
- for i,v in pairs(PC.Character:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(PC)
- end)
- end
- elseif Model and not PC then
- for i,v in pairs(Model:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(owner)
- end)
- end
- elseif not Model and not PC then
- who:SetNetworkOwner(owner)
- for i,v in pairs(who:GetDescendants()) do
- pcall(function()
- v:SetNetworkOwner(owner)
- end)
- end
- end
- end
- end
- end)
- end
- E.OnServerEvent:Connect(where)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement