Advertisement
Guest User

SCRIPT FOR CHARACTER SELECTION

a guest
Mar 23rd, 2022
6,663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. Cols Script:
  2.  
  3. local PS = game:GetService("PhysicsService")
  4. PS:CreateCollisionGroup("Clone")
  5. PS:CreateCollisionGroup("Player")
  6. PS:CollisionGroupSetCollidable("Clone", "Player", false)
  7.  
  8.  
  9. function ChangeColl(p)
  10.  
  11. if p:IsA("Part") or p:IsA("MeshPart") or p:IsA("BasePart") then
  12. PS:SetPartCollisionGroup(p, "Player")
  13. end
  14. end
  15.  
  16. function characteradded(c)
  17.  
  18. for i,v in pairs(c:GetChildren()) do
  19. if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("BasePart") then
  20. PS:SetPartCollisionGroup(v, "Player")
  21. end
  22. end
  23.  
  24. c.DescendantAdded:Connect(ChangeColl)
  25. end
  26.  
  27. function playeradded(plr)
  28. plr.CharacterAdded:Connect(characteradded)
  29. end
  30.  
  31. game.Players.PlayerAdded:Connect(playeradded)
  32.  
  33. Script:
  34.  
  35. local pickedevent = game.ReplicatedStorage.Picked
  36.  
  37. pickedevent.OnServerEvent:Connect(function(player,value)
  38. local char = player.Character
  39.  
  40.  
  41.  
  42. player.PlayerGui.SelectionGui.Enabled = false
  43. print(value)
  44. wait(0.3)
  45.  
  46. player:ClearCharacterAppearance()
  47.  
  48. if char.Head:FindFirstChild("face") then
  49. char.Head.face:Destroy()
  50. print("destroyed eyes")
  51. end
  52. print("Cleared")
  53.  
  54. wait(0.3)
  55.  
  56. local charactertoswapfolder = game.ReplicatedStorage.Characters:FindFirstChild(value)
  57. print(charactertoswapfolder.Name.." TESTT")
  58. if charactertoswapfolder then
  59.  
  60. for i, swapclothing in pairs(charactertoswapfolder:GetChildren()) do
  61. if swapclothing:IsA("Shirt") or swapclothing:IsA("Pants") or swapclothing:IsA("Accessory") or swapclothing:IsA("Hat") then
  62. swapclothing:Clone().Parent = char
  63. print("CHANGED THE BLODY CLOTHES")
  64. end
  65. end
  66.  
  67. for i, tools in pairs(charactertoswapfolder:GetChildren()) do
  68. if tools:IsA("Tool") then
  69. tools:Clone().Parent = player.Backpack
  70. end
  71. end
  72. print("CHANGED THE CLOTHING")
  73.  
  74.  
  75. end
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. end)
  84.  
  85.  
  86. Local Script:
  87.  
  88. script.Parent.MouseButton1Click:Connect(function()
  89. script.Parent.Parent.Frame.Visible = true
  90. if script.Parent.Parent.Parent.Frame.Visible == true then
  91. script.Parent.Parent.Frame.Visible = false
  92. end
  93. end)
  94.  
  95. Local Script:
  96.  
  97. local frame = script.Parent
  98. local namevalue = script.Parent.Name
  99. local selectbutton = script.Parent.Select
  100. local pickedevent = game.ReplicatedStorage.Picked
  101. local tweenService = game:GetService("TweenService")
  102.  
  103.  
  104. for _,v in pairs(frame:GetChildren())do
  105. if v:IsA("ImageButton") then
  106.  
  107.  
  108. v.MouseButton1Click:Connect(function()
  109. print("clicked")
  110. namevalue = v.Name --Change the name value to ouur image button name
  111. selectbutton.Text = namevalue
  112. print(namevalue)
  113. print("change name")
  114. end)
  115.  
  116.  
  117. v.MouseEnter:Connect(function()
  118. print("hovered over a image button")
  119. v.ImageColor3 = Color3.new(0.592157, 0.584314, 0.615686)
  120. print("changed the color")
  121.  
  122. end)
  123.  
  124. v.MouseLeave:Connect(function()
  125. if v.ImageColor3 ~= Color3.new(1, 1, 1) then
  126. v.ImageColor3 = Color3.new(1, 1, 1)
  127. end
  128. end)
  129. end
  130.  
  131. end
  132.  
  133.  
  134. --[[for _,v in pairs(frame:GetChildren())do
  135. if v:IsA("ImageButton") then
  136.  
  137.  
  138. end
  139.  
  140. end
  141. --]]
  142.  
  143. selectbutton.MouseButton1Click:Connect(function()
  144. pickedevent:FireServer(namevalue) --send over our name value, if minato it would send over minato
  145. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement