generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Roblox » Help (Technical Support and Account Issues)
Home Search
 

Re: How do i script this?

Previous Thread :: Next Thread 
KrZyGod is not online. 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
BaconOfDeath is not online. BaconOfDeath
Joined: 15 Jan 2013
Total Posts: 134
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
httpOmqCxpcake is not online. httpOmqCxpcake
Joined: 16 Feb 2016
Total Posts: 1223
02 Apr 2016 04:24 PM
ScriptingHelpers. org.

My cousin wants ze reputation.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Help (Technical Support and Account Issues)
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image