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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I do this?

Previous Thread :: Next Thread 
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 09:49 PM
I'm trying to make a script so I can choose people to get Particle Emitters in their Torso, with custom textures. Here's my script so far:

local adminpeople = {
--Format: ["Name"]="ParticleID";
["Player"]="229998161";
["Player1"]="229998161";
["liblitz56"]="229998161";
["Wyvernstrike"]="229998161";
}

if adminpeople[script.Parent.Parent.Name] then
local body = script.Parent.Parent.Character.Torso
local emitter = Instance.new("ParticleEmitter",body)
emitter.Texture = "rbxassetid://" .. adminpeople
emitter.Speed = 4
end

I figured out how to make the script without custom IDs, but I'm not sure how to structure this so the people get the texture IDs that I put with their names.
Report Abuse
Tokimonu is not online. Tokimonu
Joined: 18 Sep 2009
Total Posts: 643
05 Jun 2015 09:55 PM
If it were me, I'd do it like this:

local adminpeople = {
--format: ["PlayerName"] = true
["Player"] = true,
["Player1"] = true,
["liblitz56"] = true,
["Wyvernstrike"] = true
}

local one = 229998161
--[[local two = 229998161
local three = 229998161
local four = 229998161 -- these are all the same id's
but if you want to change them
just uncomment me w00t --]]

game.Players.PlayerAdded:connect(function(plr)
if plr.Name and adminpeople then
local emitter = Instance.new("ParticleEmitter", plr.Character.Torso)
emitter.Texture = "rbxassetid://" .. one
emitter.Speed = 4
end
end)

probably wrong and inefficient but whatever
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 09:55 PM
Bump
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 10:01 PM
Oh wow, I didn't even see the above post xD Sorry, I'll try it.
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 10:03 PM
It didn't work, there was no output.
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 10:17 PM
I found a temporary solution, but it's very messy and inefficient :(

game.Players.PlayerAdded:connect(function(player)
repeat wait(0.1) until player.Character and player.Character.Torso
if player.Name == "Player" then
local e = Instance.new("ParticleEmitter",player.Character.Torso)
e.Texture = "rbxassetid://178914035"
e.VelocitySpread = 180
e.Lifetime = NumberRange.new(2,3)
e.Speed = 4
e.RotSpeed = NumberRange.new(-50,50)
e.Rate = NumberSequence.new(10)
elseif player.Name == "lilblitz56" then
local e = Instance.new("ParticleEmitter",player.Character.Torso)
e.Texture = "rbxassetid://178914035"
e.VelocitySpread = 180
e.Lifetime = NumberRange.new(2,3)
e.Speed = 4
e.RotSpeed = NumberRange.new(-50,50)
e.Rate = NumberSequence.new(10)
else
end
end)

It would be a lot better if I could get it to work with a table.
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 10:36 PM
Figured it out :P

local admins = {
--Format = ['Name'] ImageID
['lilblitz56'] = 178914035,
['Player'] = 178914035
}
game.Players.PlayerAdded:connect(function(player)
repeat wait(0.05) until player.Character and player.Character.Torso
if admins[player.Name] then
for name,v in pairs(admins) do
admins[name:lower()] = v
local emitter = Instance.new("ParticleEmitter",player.Character.Torso)
emitter.Texture = "rbxassetid://" .. admins[name:lower()]
emitter.Speed = NumberRange.new(4)
emitter.Lifetime = NumberRange.new(2,3)
emitter.Rate = 10
emitter.RotSpeed = NumberRange.new(-50,50)
emitter.VelocitySpread = 180
end
end
end)
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 10:41 PM
Nvm, I thought it worked, but it for some reason creates 4 particle emitters :/
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
05 Jun 2015 10:47 PM
woot woot complicated time


--LocalScript
local admins = {
["lilblitz56"] = id,
["LegitimatlyMe"] = id
}

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()

if admins[plr.Name] then
game.ReplicatedStorage:WaitForChild("InsertParticles"):FireServer(admins[plr.Name])
end
--Script
game.ReplicatedStorage:WaitForChild("InsertParticles").OnServerEvent:connect(function(plr,id)
local char = plr.Character or plr.CharacterAdded:wait() --Just to be sure
local particle = Instance.new("ParticleEmitter",char:WaitForChild("Torso"))
particle.Texture = "rbxassetid://"..id
--change particles now
end)
Report Abuse
lilblitz56 is not online. lilblitz56
Joined: 06 Nov 2010
Total Posts: 461
05 Jun 2015 11:34 PM
^ xD I don't think that would work to well, thanks anyways though.
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
05 Jun 2015 11:37 PM
did you test it?
did you put things in the correct place?
did it do crap(error,make a new particleemitter)?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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