Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
12

SpotLight Color the Color of Players Head? [closed]

Asked by 10 years ago

So this is the script I have. It has some other stuff in it but I'm confused on the spotlight.color thingy. If you find any other errors with the scripts feel free to tell me :D

wait()
player = game.Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
SpotLight = Instance.new("SpotLight", player.Character.Head)
SpotLight.Brightness = (.85)
SpotLight.Angle = (120)
SpotLight.Color = player.Character.Head.Color

Locked by JesseSong

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

3 answers

Log in to vote
4
Answered by 10 years ago

Parts don't have Colors, instead they have BrickColors.

wait()
player = game.Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
SpotLight = Instance.new("SpotLight", player.Character.Head)
SpotLight.Brightness = (.85)
SpotLight.Angle = (120)
SpotLight.Color = player.Character.Head.BrickColor

2
Hmm okay Thanks :) I new it was something simple. YellowoTide 1992 — 10y
0
Yeah. Usually guis and lights use Color3 values. 3D guis and parts use BrickColors usually. soaprocks2 75 — 10y
Ad
Log in to vote
0
Answered by
nobo404 17
8 years ago

Instead of "Color", you need to use the function BrickColor(), which returns the color of the part. (Sorry if I am wrong about it being a function, but I'm pretty sure you would need to use player.Character.Head.BrickColor())

EDIT: Sorry, it's not a function, so just remove all the parentheses in my example, so it should be player.Character.Head.BrickColor

Log in to vote
0
Answered by
sigve10 94
8 years ago

A part's color is made up of a BrickColor. A spotlight's color is made up of a Color3. Basically what you need, is a way of grabbing the part's BrickColor, and somehow get a Color3 out of that. Luckily, ROBLOX makes this quite simple, by adding a Color property to BrickColor. This means that you would only have to use player.Character.Head.BrickColor.Color to get the Color3 value out of the part!