|
| 10 Apr 2015 10:00 AM |
How would I make a door turn semi-transparent when anyone says "Open" Please explain this to me. Thanks! |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 10:00 AM |
| http://wiki.roblox.com/index.php?title=Absolute_beginner%27s_guide_to_scripting |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Apr 2015 05:42 PM |
name the door ‘Door” and put this in serverscriptservice
door = workspace.Door
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg, rec)
if string.lower(msg) == “open” then
door.Transparency = .5 wait(1) door.Transparency = 0
end
end)
end) |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Apr 2015 05:45 PM |
@boj, just giving people the answer doesn't help them at all.. in the future you should think about just direct them to a wiki link. Also, why would you want to give them a free answer? They get progress for doing nothing. And you don't have to 'prove yourself' if that's why you gave them the code.
http://wiki.roblox.com/index.php?title=API:Class/Player/Chatted
|
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 05:49 PM |
I hate doing things I don't understand. That's what sets me apart from other people. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 06:58 PM |
| That's what sets you apart from becoming a scripter. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:03 PM |
*Whacks with meter stick*
Out! |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:04 PM |
| And I AM a scripter. Just learning something new. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 10 Apr 2015 07:09 PM |
--First you must make a reference to the door.
local door = game.Workspace.Door
--Then you must wait for players to chat
game.Players.PlayerAdded:connect(function(player) -- Player that joined player.Chatted:connect(function(msg) -- Message he chatted if msg:lower() == "open" then -- If the message matches open door.Transparency = 0.5 -- Change transparency door.CanCollide = false -- Change cancollide end end) end)
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
| |
|
jode6543
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 5363 |
|
|
| 10 Apr 2015 07:35 PM |
string.lower("I'm a string!") is the same as ("I'm a string!"):lower() The same goes for all the other string manipulation functions. This is because this: x:y(...) is actually syntactic for this: x.y(x, ...) And also because metatables, but I won't delve into that for now. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Apr 2015 07:39 PM |
OP says he's a scripter > OP can't figure out how to construct a basic Chatted event
k |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:41 PM |
| I never bothered to learn it. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:42 PM |
| And I still don't know what message:lower means. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Apr 2015 07:43 PM |
| Yeah but if you, like you say you are, a scripter.. you undoubtedly could have just searched it up on the wiki and been on your way. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:46 PM |
I know a little bit of: Swift C++ C |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Apr 2015 07:46 PM |
:lower() is a string formatting method, it converts a given string into all lowercase letters.
string.lower('A') --> 'a'
local a = 'A' a:lower() --> a
It's often used for eradicating unwanted specific cases in Chat commands.
If I do..
'if msg:lower() == "hello" '
then I can say: 'hello', 'Hello', 'HEllo', 'HelLo', 'hEllO'.. etc.. and they will all pass the if statement. Wheras if I had this;
'if msg == "hello" '
then I would HAVE to say 'hello' to activate it. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 07:50 PM |
Too late. I already looked it up on the Wiki. Thanks. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2015 09:01 PM |
| @Goulstem, who am i trying to impress? Lol. But your right |
|
|
| Report Abuse |
|
|