|
| 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
|
  |
| 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 |
|
|
| |
|
|
| 05 Jun 2015 10:01 PM |
| Oh wow, I didn't even see the above post xD Sorry, I'll try it. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2015 10:03 PM |
| It didn't work, there was no output. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 05 Jun 2015 10:41 PM |
| Nvm, I thought it worked, but it for some reason creates 4 particle emitters :/ |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 05 Jun 2015 11:34 PM |
| ^ xD I don't think that would work to well, thanks anyways though. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|