|
Button = script.Parent.Parent
Player = Button.Parent.Parent.Parent.Parent
RightArm = Player.Character["Right Arm"]
function onButtonClicked()
wait(0.1)
RightArm.BrickColor = BrickColor.new("Black")
end
Button.MouseButton1Click:connect(onButtonClicked)
What is wrong? |
|
|
Before asking us what is wrong, tell us what it's supposed to do... |
|
shayan414Join Date: 2008-08-11 Post Count: 8090 |
@Julien
It's pretty obvious that when you click the brick it makes your right arm black. >.> |
|
|
|
look in your explorer, and tell me, what is script.Parent.Parent.Parent.Parent.Parent (that would be Player)
tell what each of your variables is supposed to be, then i can help.
also, before i help with those, the connection line should be this:
Button.ClickDetector.MouseClick:connect(onButtonClicked)
make sure that your button has a clickdetector in it |
|
|
Shouldnt it be, Charater.["Right Arm"] ? |
|
|
Like this?
Button = script.Parent.Parent
Player = Button.Parent.Parent.Parent.Parent
RightArm = Player.Charater["Right Arm"]
function onButtonClicked()
wait(0.1)
RightArm.BrickColor = BrickColor.new("Black")
end
Button.ClickDetector.MouseClick:connect(onButtonClicked)
Button.MouseButton1Click:connect(onButtonClicked) |
|
shayan414Join Date: 2008-08-11 Post Count: 8090 |
It character not charater. |
|
|
|
pighead10Join Date: 2009-05-03 Post Count: 10341 |
You need a ClickDetector methinks. Add one in script.Parent.Parent and change the last line to 'Button.ClickDetector' |
|
|
|
baka333Join Date: 2008-11-26 Post Count: 57 |
tell us wat the issue with the script is before u give us the script |
|
Lucas_LuaJoin Date: 2008-06-18 Post Count: 7521 |
use a local script, so you can access the variable LocalPlayer out of Players. |
|
|
if i new what was wrong i would fix it. |
|
BlabobloxJoin Date: 2008-09-12 Post Count: 8945 |
Did you learn nothing from Blab's help yesterday? |
|
|
BlabobloxJoin Date: 2008-09-12 Post Count: 8945 |
repeat wait to wait for the character! |
|
|
BlabobloxJoin Date: 2008-09-12 Post Count: 8945 |
Stupid goldfish. >_< |
|
|
|
I know I know
repeat wait() until Player.Character ~= nil
but it didnt work in last script |
|
|
|