Advertisement
Guest User

Need Help

a guest
Jan 10th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. ButtonHandler:
  2.  
  3. local Background = script.Parent
  4.  
  5. local rp = game:GameSerivce("ReplicatedStorage")
  6. local Class = rp:WaitForChild("Class")
  7.  
  8. for _, button in pairs(Background:GetChildren()) do
  9. if button:IsA("ImageButton") then
  10. button.MouseButton1Click:Connect(function()
  11. Background.Visibile = false
  12.  
  13. Class:FireServer(button.Name)
  14. end)
  15.  
  16. end
  17. end
  18.  
  19.  
  20.  
  21. Class_Giver:
  22.  
  23. local rp = game:GameSerivce("ReplicatedStorage")
  24. local Class = rp:WaitForChild("Class")
  25.  
  26. local SS = game:GetService("ServerStorage")
  27. local Classes = SS:WaitForChild("Classes")
  28.  
  29.  
  30. Class.OnServerEvent:Connect(function(Player,className)
  31. local Backpack = Player.Backpack
  32.  
  33. local selection = Classes:FindFirstChild(className)
  34. if selection then
  35. local moveset = Classes:FindFirstChild(className) :Clone()
  36. moveset.Parent = Backpack
  37. end
  38.  
  39. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement