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

How do i fix my chat command? I made this today and it is broken please help me

Asked by 9 years ago

Hello, well i don't really need to make the chat command only for specific players but i would appreciate it. Well please fix my script.

01d1 = game.Workspace.Door
02d2 = game.Workspace.Door2
03 
04game.Players.ChildAdded:connect(function(Player)
05    Player.Chatted:connect(function(msg)
06        if msg == "open2" then
07    d1.Transparency = 0.5
08    d2.Transparency = 0.5
09    d1.BrickColor = ("Forest green")
10    d2.BrickColor = ("Forest green")
11    d1.CanCollide = false
12    d2.CanCollide = false
13        end
14    end)
15end)

IDK Why it doesn't change the color of part, and make the cancollide false. The only thing it does is make transparency 0.5 if someone could fix this script for me and maybe make it like true admin that has like admin list it would be really helpful for me. I am pretty basic in lua and i can't do anything advanced.

1
here develop_d 53 — 5y
1
lol develop_d 53 — 5y
1
Is there no delay between comments develop_d 53 — 5y
1
bro ur 3 years late kaspar1230 345 — 5y
View all comments (9 more)
1
wait idk kaspar1230 345 — 5y
1
I think you get 1 rep develop_d 53 — 5y
1
for develop_d 53 — 5y
1
lolllllllllllllllllllllll kaspar1230 345 — 5y
1
upvoting develop_d 53 — 5y
1
comments develop_d 53 — 5y
1
lmao this is gay kaspar1230 345 — 5y
1
keep doing it kaspar1230 345 — 5y
1
ah kaspar1230 345 — 5y

2 answers

Log in to vote
0
Answered by
Hasburo 150
9 years ago
01d1 = game.Workspace.Door
02d2 = game.Workspace.Door2
03 
04game.Players.ChildAdded:connect(function(Player)
05    Player.Chatted:connect(function(msg)
06        if msg == "open2" then
07    d1.Transparency = 0.5
08    d2.Transparency = 0.5
09    d1.BrickColor = BrickColor.new("Forest green")
10    d2.BrickColor = BrickColor.new("Forest green")
11    d1.CanCollide = false
12    d2.CanCollide = false
13        end
14    end)
15end)

A simple fix, really. When changing a color of a brick, or a few other things, you must use BrickColor.new.

Refer here for more information.

1
Thanks kaspar1230 345 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

pff I can do alot better than the person above. try this.

01d1 = game.Workspace.Door1
02d2 = game.Workspace.Door2
03game.Players.ChildAdded:connect(function(Player)
04    print(Player.Name)
05    Player.Chatted:connect(function(msg)
06    print(Player.Name .. ": " .. msg)
07        if msg:lower() == "open" then
08    d1.Transparency = 0.5
09    d2.Transparency = 0.5
10    d1.BrickColor = BrickColor.new("Forest green")
11    d2.BrickColor = BrickColor.new("Forest green")
12    d1.CanCollide = false
13    d2.CanCollide = false
14elseif msg:lower()   == 'close' then
15 
View all 24 lines...
0
well, my end result was kaspar1230 345 — 9y
0
was? Angels_Develop 52 — 9y

Answer this question