Advertisement
bobopopcornboy

player killer server

Sep 2nd, 2024 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. if workspace:FindFirstChild("MrBigHatsProperty") then
  2.   workspace.MrBigHatsProperty:Destroy()
  3. end
  4. folder = Instance.new("Folder")
  5. folder.Parent = workspace
  6. folder.Name = "MrBigHatsProperty"
  7. event = Instance.new("RemoteEvent")
  8. event.Parent = folder
  9. event.Name = "KILL"
  10. Players = game.Players:GetChildren()
  11.  
  12. event.OnServerEvent:Connect(function(player,cmd,arg,Vic)
  13.         if cmd == "kill" then
  14.         print(player.Name.."tried to kill"..arg)
  15.         if game.Players:FindFirstChild(arg) then
  16.             game.Players[arg].Character.Humanoid.Health = 0
  17.         end
  18.         elseif cmd == "skin" then
  19. Target = owner
  20. if Vic then Target = Vic end
  21. id = game:GetService("Players"):GetUserIdFromNameAsync(arg)
  22.  
  23. local oldModel = owner.Character
  24. local newModel = game.Players:CreateHumanoidModelFromUserId(id)
  25. newModel.Humanoid.DisplayName = arg
  26. newModel.Humanoid.MaxHealth = math.huge
  27.  
  28. local oldCFrame = oldModel:GetPrimaryPartCFrame()
  29.  
  30. Target.Character = newModel
  31. newModel.Parent = workspace -- [1] this follows current character loading behavior
  32. newModel:SetPrimaryPartCFrame(oldCFrame)
  33. oldModel:Destroy()
  34.  
  35.         end
  36. end)
Tags: Server Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement