{SOLVED}The following script is supposed to make the part(which the script is in it) to uncheck CanCollide property and make the part's transparency 0 for 5 seconds. Here is the script:
game.Players.PlayerAdded:connect(function(msg) if Player.msg == "boss" then CanCollide = false transparency = 1 while true do wait(5) CanCollide = true transparency = 0 end end end
The script is not working, I am new to scripting so you will find lots of mistakes. -Thank you if you answered my question, I will be sure to upvote and accept your answer if it is correct!(SOLVED}
Your function: game.Players.PlayerAdded:connect(function(msg)
Its just calling the function msg when a player comes in, I might be wrong but I'm thinking that you want the door to take cancollide off and change transparency when someone says "boss", Player.msg doesn't mean if the player says _ word it will do _, it does nothing but error. Plus, your not saying what you want to be CanCollide off and transparency 1, from my view, its a part. I also don't get why you used a while true do which means it will just not let you ever make it cancollide off and transparency 1.
Try this:
--Vividex local p = game.Workspace.Part --Made the part a variable, easier for me function onChatted(msg, recipient, Speaker) if msg == "boss" then p.CanCollide = false p.Transparency = 1 wait(5) --waits 5 seconds after saying "boss" p.CanCollide = true --after 5 seconds changes the parts cancollide to true p.Transparency = 0 --after 5 seconds changes the parts Transparency to 0 end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)
You spelled "CanCollide" wrong.
there should be two ='s on line 2.
if Player.msg == "boss" then
Powered by Chipio Industries
Upvote if this post was useful