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 8 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.

d1 = game.Workspace.Door
d2 = game.Workspace.Door2

game.Players.ChildAdded:connect(function(Player)
    Player.Chatted:connect(function(msg)
        if msg == "open2" then
    d1.Transparency = 0.5
    d2.Transparency = 0.5
    d1.BrickColor = ("Forest green")
    d2.BrickColor = ("Forest green")
    d1.CanCollide = false
    d2.CanCollide = false
        end
    end)
end)

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
8 years ago
d1 = game.Workspace.Door
d2 = game.Workspace.Door2

game.Players.ChildAdded:connect(function(Player)
    Player.Chatted:connect(function(msg)
        if msg == "open2" then
    d1.Transparency = 0.5
    d2.Transparency = 0.5
    d1.BrickColor = BrickColor.new("Forest green")
    d2.BrickColor = BrickColor.new("Forest green")
    d1.CanCollide = false
    d2.CanCollide = false
        end
    end)
end)

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 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

d1 = game.Workspace.Door1
d2 = game.Workspace.Door2
game.Players.ChildAdded:connect(function(Player)
    print(Player.Name)
    Player.Chatted:connect(function(msg)
    print(Player.Name .. ": " .. msg)
        if msg:lower() == "open" then
    d1.Transparency = 0.5
    d2.Transparency = 0.5
    d1.BrickColor = BrickColor.new("Forest green")
    d2.BrickColor = BrickColor.new("Forest green")
    d1.CanCollide = false
    d2.CanCollide = false
elseif msg:lower()   == 'close' then

        d1.Transparency = 0
    d2.Transparency = 0
    d1.BrickColor = BrickColor.new("Really red")
    d2.BrickColor = BrickColor.new("Really red")
    d1.CanCollide = true
    d2.CanCollide = true
        end
    end)
end)

0
well, my end result was kaspar1230 345 — 8y
0
was? Angels_Develop 52 — 8y

Answer this question