Advertisement
Anukun_Lucifer

OnPlayerAdded (Script / EP.09)

Jan 20th, 2024
1,476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | Gaming | 0 0
  1. local players = game:GetService("Players")
  2. local physicsservice = game:GetService("PhysicsService")
  3.  
  4. players.PlayerAdded:Connect(function(player)
  5.    
  6.     local gold = Instance.new("IntValue")
  7.     gold.Name = "Gold"
  8.     gold.Value = 250
  9.     gold.Parent = player
  10.    
  11.     local placedTowers = Instance.new("IntValue")
  12.     placedTowers.Name = "PlacedTowers"
  13.     placedTowers.Value = 0
  14.     placedTowers.Parent = player
  15.    
  16.     player.CharacterAdded:Connect(function(character)
  17.         for i, object in ipairs(character:GetDescendants()) do
  18.             if object:IsA("BasePart") then
  19.                 physicsservice:SetPartCollisionGroup(object, "Player")
  20.             end
  21.         end
  22.     end)
  23. end)
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement