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 » Scripters
Home Search
 

Re: character light

Previous Thread :: Next Thread 
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 03:16 PM
b1
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 03:23 PM
b2
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 04:14 PM
b3
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 04:16 PM
b4
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 04:20 PM
b5
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 04:25 PM
SOMEONE HELP
Report Abuse
KarthonTulliusEnnius is not online. KarthonTulliusEnnius
Joined: 30 May 2010
Total Posts: 230
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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
30 Apr 2016 04:40 PM
did not work
Report Abuse
KarthonTulliusEnnius is not online. KarthonTulliusEnnius
Joined: 30 May 2010
Total Posts: 230
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
DivinePheonix is not online. DivinePheonix
Joined: 30 Mar 2011
Total Posts: 11190
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 is not online. 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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
02 May 2016 10:53 PM
bump(lost count)
Report Abuse
TimeTicks is not online. 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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
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
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
02 May 2016 11:51 PM
bump
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
03 May 2016 12:05 AM
anotha one...someone please help(bump)
Report Abuse
ComplexitiesLife is not online. ComplexitiesLife
Joined: 31 Mar 2016
Total Posts: 260
03 May 2016 12:10 AM
IM DESPO HELP
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