Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- reference: "Deathcam LocalScript" inside "PlayerGui / StarterGui"
- function WaitForChild(where, what)
- repeat
- wait()
- until where:FindFirstChild(what)
- return where:FindFirstChild(what)
- end
- local Players = game:GetService("Players")
- local Player = Players.LocalPlayer
- local Character = Player.Character -- character should exist
- local PlayerHumanoid = WaitForChild(Character,"Humanoid")
- local ObjectValue = Instance.new("ObjectValue")
- ObjectValue.Parent = Character
- ObjectValue.Name = "LastHitter"
- PlayerHumanoid.ChildAdded:connect(function(obj)
- if (obj:IsA("ObjectValue")) then
- ObjectValue.Value = obj.Value
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement