|
| 30 Apr 2016 03:06 PM |
function Spawned(char) L = Instance.new("PointLight", char.Torso) end
function PlayerAdded(player) player.CharacterAdded:connect(Spawned) end game.Players.PlayerAdded:connect(PlayerAdded)
--does not work please fix |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| 30 Apr 2016 04:32 PM |
Change it to this
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) L = Instance.new("PointLight", char.Torso) end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Apr 2016 04:45 PM |
Forgot to set L as a variable.. use local to do that.... this works...
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) local L = Instance.new("PointLight", char.Torso) end) end)
You might not be able to see it unless the environment is very dark. It may help to edit brightness and range if you have brightness issues..
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) local L = Instance.new("PointLight", char.Torso) L.Brightness = "2" --change the number if you wish, 1 is default L.Range = "12" -- change the number if you wish, 8 is default end) end)
|
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 04:46 PM |
Just use a local script in StarterGui
repeat wait() until game.Players.LocalPlayer.Character.Torso local Light = Instance.new("PointLight",game.Players.LocalPlayer.Character.Torso)
If you want it to only work once, place it in StarterPlayerScripts |
|
|
| Report Abuse |
|
|
Yamno
|
  |
| Joined: 10 Jun 2009 |
| Total Posts: 123 |
|
|
| 30 Apr 2016 04:48 PM |
what is supposed to happen?
does the light actually appear in the character torso? |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2016 05:50 PM |
| EDIT: I forgot something reallyyy important my game has a R15 character instead of R6 so none of these script work with it..how would i do this for a R15 character and if some of you dont know im trying to add a light in the chars torso |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 May 2016 11:06 PM |
like everyone else
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) local light = Instance.new("PointLight",char.Torso) end) end)
If you don't know what the torso is, when you play the game just look in the workspace for your character model, and find what the torso is called if any.
|
|
|
| Report Abuse |
|
|
|
| 02 May 2016 11:38 PM |
I played around with a model and made it so that wen you touch the spawn the light gets added into the part of the player that touched it...can someone tweak this so that everytime a player spawns it adds a light into any part of player the above dont work with my R15 char..
game.Workspace.Spawn.Touched:connect(function(hit) local human = hit.Parent:FindFirstChild("Humanoid")--Finds the player that touches it so it only applies to that player. local BPs = hit.Parent:GetChildren() if not human or human.Health == 0 then--makes sure the player is not dead... end for i,v in pairs(BPs) do if v.ClassName == "Part" then Instance.new("PointLight",v) v.BodyForce.Name = "x" wait(.1) v.x.Range = 20 while true do-- So a player dose not get the light multiple times... wait(1) end end end end)
|
|
|
| Report Abuse |
|
|
| |
|
|
| 03 May 2016 12:05 AM |
| anotha one...someone please help(bump) |
|
|
| Report Abuse |
|
|
| |
|