|
| 23 Mar 2017 01:01 PM |
So i'm trying to make a script which changes the color of marshmellow head to brown, when touching a brick above fire.
I tried creating it but i do not know what have I done wrong
local cookingPart = script.Parent
local function cookMarshmellow(tool) local cook = Instance.new("BrickColor") cook.BrickColor.new(int 1014) cook.Name = "Cooked Marshmallow" cook.Parent = Players end
cookingpart.Touched:connect(cookMarshmellow)
Im a really noob scripter, started today. |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:13 PM |
I think it's like this:
local cookingPart = script.Parent
function cookMarshmallow(tool) local cook = Instance.new("BrickColorValue") cook.Value = BrickColor.new("Bright red") cook.Name = "Cooked Marshmallow" cook.Parent = game.Players end
cookingPart.Touched:connect(cookMarshmallow)
You can't use an int for a value
change the "Bright red" to wichever color you'd like
|
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:14 PM |
*You can't use an int for a brickcolorvalue
|
|
|
| Report Abuse |
|
|
Auracyte
|
  |
| Joined: 01 Feb 2011 |
| Total Posts: 330 |
|
|
| 23 Mar 2017 01:16 PM |
Change local cook = Instance.new("BrickColor")
to
local cook = Instance.new("Part") |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:16 PM |
Btw this just sets the colorValue, but it does not assign the color to a brick
|
|
|
| Report Abuse |
|
|
Auracyte
|
  |
| Joined: 01 Feb 2011 |
| Total Posts: 330 |
|
| |
|
|
| 23 Mar 2017 01:19 PM |
| how to assign color to a brick? |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:22 PM |
place the part in workspace, then this:
game.Workspace.(Name of part).BrickColor = BrickColor.new("Bright red")
again, change "Bright red" to whatever color wich is available in the palette
|
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:29 PM |
Im trying to add the color changing effect to a tool upon colliding with a part, which is touched by brick above bonfire. if i put the script location to workspace, after picking it up from ground, it goes to backpack, what directory do i need to put then? |
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 01:38 PM |
game.Players.BackPack
it is inside the character when it is equipped so then it is:
game.Workspace.(Playername)
|
|
|
| Report Abuse |
|
|
|
| 23 Mar 2017 02:00 PM |
| thank you for the help, finally got it to work |
|
|
| Report Abuse |
|
|