RazBerry916

Untitled

Jun 22nd, 2023
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | Source Code | 0 0
  1. -- LocalScript
  2. game.Players.PlayerAdded:Connect(function(player)
  3. -- Wait for the player to load
  4. wait() -- Delay for a brief moment to ensure the player's team data is available
  5. local head = script.Parent.Parent.Head
  6. local tycoon1Team = game.Teams:FindFirstChild("Tycoon 1")
  7. local neutralTeam = game.Teams:FindFirstChild("Neutral")
  8. local near = game.Teams:FindFirstChild("Near Tycoon 1")
  9. player.Team = neutralTeam
  10. wait()
  11.  
  12. while head.Transparency ~= 0.5 do
  13. wait() -- Wait for the Head's transparency to be 0.5
  14. end
  15. if player.Team == neutralTeam and workspace.Head.Transparency == 0.5 then
  16. wait()
  17. head.Transparency = 0
  18. head.PlayerOwner.Value = ""
  19. head.SurfaceGui.TextLabel.Text = "Touch to claim!"
  20. print("Player is trying to cheat without being in the near team.")
  21. -- Teleport the player to the spawn location
  22. local spawnLocation = game.Workspace.SpawnLocation -- Replace with the actual spawn location
  23. player.Character:SetPrimaryPartCFrame(spawnLocation.CFrame)
  24.  
  25. if player.Team == near and workspace.Head.Transparency == 0.5 then
  26. print("Player is in the near team, so now they are in the tycoon 1 team.")
  27. end
  28. end
  29. end)
  30.  
Tags: lua roblox
Advertisement
Add Comment
Please, Sign In to add comment