Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local targetPosition = Vector3.new(345,69,339)
- local offset = Vector3.new(0, 0, -3)
- local speed = 0.00001
- local function attachPartsToPlayer(player)
- local entity = player:getEntity()
- if not entity then return end
- local pointerMiddle = PartService.createPart(ItemType.CLAY_BLACK, entity:getCFrame().Position + offset)
- pointerMiddle:setSize(Vector3.new(0.5, 0.5, 3.9))
- pointerMiddle:setCollidable(false)
- pointerMiddle:setAnchored(true)
- pointerMiddle:setTransparency(0)
- local leftPointerOffset = Vector3.new(-0.9, 0, -1)
- local rightPointerOffset = Vector3.new(0.9, 0, -1)
- local pointerSize = Vector3.new(0.5, 0.5, 2.5)
- local leftPointer = PartService.createPart(ItemType.CLAY_BLACK, entity:getCFrame().Position + offset + leftPointerOffset)
- leftPointer:setSize(pointerSize)
- leftPointer:setCollidable(false)
- leftPointer:setAnchored(true)
- leftPointer:setTransparency(0)
- local rightPointer = PartService.createPart(ItemType.CLAY_BLACK, entity:getCFrame().Position + offset + rightPointerOffset)
- rightPointer:setSize(pointerSize)
- rightPointer:setCollidable(false)
- rightPointer:setAnchored(true)
- rightPointer:setTransparency(0)
- local function updatePartPosition()
- while entity and entity:isAlive() do
- local playerCFrame = entity:getCFrame()
- pointerMiddle:setCFrame(playerCFrame * CFrame.new(offset))
- rightPointer:setCFrame(playerCFrame * CFrame.new(rightPointerOffset))
- leftPointer:setCFrame(playerCFrame * CFrame.new(leftPointerOffset))
- local lookAtCFrame = CFrame.lookAt(pointerMiddle:getPosition(), targetPosition)
- pointerMiddle:setCFrame(lookAtCFrame)
- rightPointer:setCFrame(lookAtCFrame * CFrame.new(rightPointerOffset) * CFrame.Angles(0, math.rad(-135), 0))
- leftPointer:setCFrame(lookAtCFrame * CFrame.new(leftPointerOffset) * CFrame.Angles(0, math.rad(135), 0))
- task.wait(speed)
- end
- end
- task.spawn(updatePartPosition)
- end
- for _, player in pairs(PlayerService.getPlayers()) do
- attachPartsToPlayer(player)
- end
- Events.EntityDeath(function(event)
- local entity = event.entity
- if not entity then return end
- local player = entity:getPlayer()
- if player then
- attachPartsToPlayer(player)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement