KrZyGod
|
  |
| Joined: 21 Mar 2016 |
| Total Posts: 1 |
|
|
| 02 Apr 2016 03:35 PM |
| I want to make it where a person joins my game and they pick a class on my gui (which is already created) and spawn with the weapons..I dont want it to where they spawn in the game and its already in their starterpack. |
|
|
| Report Abuse |
|
|
| 02 Apr 2016 03:47 PM |
While I can't give you an exact script because I don't know how your GUI is scripted, you can do something like this:
1. When you click on the class in the GUI, give the player a variable named "Class" and change its value to whatever class they picked
Ex (This Script would be in the button for warrior; you would need to have one like this for all buttons with classes): function OnClicked() class = Instance.new("StringValue") class.Parent = game.Players.LocalPlayer class.Name = "Class" class.Value = "warrior" end script.Parent.MouseButton1Down:connect(OnClicked)
2. Check what their class is, and insert the appropriate weapons into their StarterPack (usually by cloning them from lighting but you can do something else)
Ex: if game.Players.LocalPlayer.Class == "warrior" then axe = game.Lighting.Axe:Clone() --Gives the player their weapon(s) axe.Parent = game.Players.LocalPlayers.StarterPack end
3. Remove the class GUI from the player's StarterGUI so they don't spawn with it again
4. Kill the player so they respawn with their weapons
This might not be the best method, but it is what I would do. Ask questions if I explained something poorly or wrote something incorrectly. |
|
|
| Report Abuse |
|
|
| 02 Apr 2016 04:24 PM |
ScriptingHelpers. org.
My cousin wants ze reputation. |
|
|
| Report Abuse |
|