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 » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How do I make someone spawn with one random magic?

Previous Thread :: Next Thread 
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:13 PM
Im making a fairy tail game i have the magics ready and I put them all in starterpack when I join the game I have all the magics obviously Could someone tell me how to make it so they spawn with only one random magic out of them? Thank you alot
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:14 PM
game.CharacterSpawned:connect(function(char)
char:CorePowerEnabled("Fly",true) -- Enables 'flying' ability.
end)
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
23 Jul 2014 12:14 PM
... What?
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
23 Jul 2014 12:15 PM
Is this some kind of crazy magic?
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:15 PM
The thread has been answered.
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:16 PM
What do you mean it makes you fly or does it do a random magic?Do i just copy that into a script and put it in workspace?
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:17 PM
yeah
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Jul 2014 12:18 PM
super pls, you don't need to troll.

owait im a hypocrite
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:19 PM
Oh and, if you want it to give random magic then here:


game.CharacterSpawned:connect(function(char)
char:CorePowerEnabled(math.random(1,#Powers),true) -- Enables random ability.
end)
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:22 PM
by that it gives them a random magic from the starterpack right qq im a noob
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:23 PM
No, it gives them magic powers built in by Roblox.
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
23 Jul 2014 12:26 PM
This one is more detailed

function OnPlayerEntered(LaaaLaaa Operaaaaah)

Player.CoreMagicPowers:PowersActive.PowerActivated = CoreMagicPowers:math.random(-pi,pi);

Should work.
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
23 Jul 2014 12:26 PM
wait forgot to put this on the end

game.Players.PlayerAdded:connect(onPlayerEntered)
onPlayerEntered(game.Players:WaitForChild("Laaa Laaa Operaaaah"))
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:28 PM
I just want a script that only gives one random tool from starterpack :(
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Jul 2014 12:29 PM
okie trolls, you can leave now

make a model in ReplicatedStorage named Magix with all the tools in it

local magix = game.ReplicatedStorage.Magix:GetChildren()

game.Players.PlayerAdded:connect(function(player)
local magic = magix[math.random(1, #magix)]:Clone()
magic.Parent = player.Backpack
end)

owait im a hypocrite
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Jul 2014 12:30 PM
Edit:

local magix = game.ReplicatedStorage.Magix:GetChildren()

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function()
local magic = magix[math.random(1, #magix)]:Clone()
magic.Parent = player.Backpack
end)
end)

owait im a hypocrite
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:30 PM
is that a troll?If it is im getting really annoyed
Report Abuse
fret13103 is not online. fret13103
Joined: 15 Mar 2010
Total Posts: 881
23 Jul 2014 12:30 PM
Shadow, do what Devious posted :)

we were just having some fun.
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Jul 2014 12:31 PM
It's not a troll.

owait im a hypocrite
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:32 PM
OK

MOVE ALL THE TOOLS IN STARTERPACK INSIDE ReplicatedStorage

and put this inside a script in workspace
--


game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
repeat wait() until plr.Backpack

storage = game.ReplicatedStorage

newPower = storage:GetChildren()[math.random(1,#storage:GetChildren())]

newPower:clone()
newPower.Parent = plr.Backpack

end)
end)
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:35 PM
where do I put the script in workspace right?
Report Abuse
super10099 is not online. super10099
Joined: 30 Jan 2010
Total Posts: 1102
23 Jul 2014 12:35 PM
@ DeviousDeviation

I didn't know you posted one already :c
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:36 PM
nvm
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
23 Jul 2014 12:36 PM
No, put it in ServerScriptService.

owait im a hypocrite
Report Abuse
shadow99967 is not online. shadow99967
Joined: 08 Apr 2011
Total Posts: 72
23 Jul 2014 12:45 PM
didnt work
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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