Advertisement
Filipono120

[ROBLOX][FE] CustomDeathScript v1

Oct 31st, 2020 (edited)
947
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. --// CustomDeathScript
  2. --// Writtened by filipaogamer345 (solo dev).
  3. --// Change the sound asset-id at the line 16 if you want.
  4.  
  5. local player = game.Players.LocalPlayer
  6.  
  7. local NetworkAccess = coroutine.create(function()
  8.     settings().Physics.AllowSleep = false
  9.     wait(math.random(1.5, 3))
  10.     while true do
  11.         game:GetService('RunService').RenderStepped:Wait()
  12.         for _, players in pairs(game.Players:GetChildren()) do
  13.             if players ~= game.Players.LocalPlayer then
  14.                 players.MaximumSimulationRadius = 0.1
  15.                 players.SimulationRadius = 0
  16.             end
  17.         end
  18.         player.MaximumSimulationRadius = math.pow(math.huge, math.huge)
  19.         player.SimulationRadius = math.huge * math.huge
  20.     end
  21. end)
  22. coroutine.resume(NetworkAccess)
  23.  
  24. local function Update()
  25.     local connection = nil
  26.     if connection ~= nil then
  27.         connection:Disconnect()
  28.     end
  29.     connection = coroutine.resume(coroutine.create(function()
  30.         for _, player in pairs(game.Players:GetPlayers()) do
  31.             local character = player.Character
  32.             local humanoid = character:findFirstChild("Humanoid")
  33.             humanoid.Died:Connect(function()
  34.                 local sound = Instance.new("Sound", workspace)
  35.                 sound.SoundId = "rbxasset://sounds/uuhhh.mp3"
  36.                 sound.Volume = 20
  37.                 sound:Play()
  38.                 game.Debris:AddItem(sound, 1.5)
  39.             end)
  40.         end
  41.     end))
  42. end
  43.  
  44. Update()
  45.  
  46. game.Players.PlayerAdded:Connect(function()
  47.     Update()
  48. end)
  49.  
  50. game.Players.PlayerRemoving:Connect(function()
  51.     Update()
  52. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement