Advertisement
Upscalefanatic3

Deadmist 2 | Item Spawner

Feb 11th, 2019
1,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local player=game:GetService'Players'.LocalPlayer
  2.  
  3. local function createTorsoRayCast(RandomPos)
  4.  
  5. if RandomPos == nil then
  6.  
  7. local hit, position = workspace:FindPartOnRayWithIgnoreList(Ray.new(player.Character.HumanoidRootPart.Position + player.Character.HumanoidRootPart.CFrame.lookVector * 4, Vector3.new(0, -999, 0)), {}, true)
  8.  
  9. if hit then
  10.  
  11. return position
  12.  
  13. else
  14.  
  15. return nil
  16.  
  17. end
  18.  
  19. else
  20.  
  21. local hit, position = workspace:FindPartOnRayWithIgnoreList(Ray.new(player.Character.HumanoidRootPart.Position + Vector3.new(math.random(-3, 3), 0, math.random(-3, 3)), Vector3.new(0, -999, 0)), {}, true)
  22.  
  23. if hit then
  24.  
  25. return position
  26.  
  27. else
  28.  
  29. return nil
  30.  
  31. end
  32.  
  33. end
  34.  
  35. end
  36. game.Workspace.Water.i:FireServer({'Item Name','Pristine'}, createTorsoRayCast(),workspace.conf.Value) -- Only this updated xd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement