Top posting users this month | |
Latest topics | » Where to go from here.September 14th 2020, 1:20 pm by MrNicNac» Send me an EmailSeptember 14th 2020, 1:16 pm by MrNicNac» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]July 6th 2015, 7:38 pm by m27frogy» New Site PossiblyJuly 6th 2015, 4:16 pm by m27frogy» Ambassador!April 15th 2015, 11:40 pm by naknak» Boop - TagApril 13th 2015, 9:46 pm by naknak» Vip Class ScriptApril 13th 2015, 4:54 pm by naknak» Who's active?!April 13th 2015, 4:52 pm by naknak» Genesis PointJuly 17th 2014, 7:04 pm by branefreez» Reward SystemJuly 17th 2014, 5:41 am by m27frogy» Script RequestJuly 10th 2014, 11:43 am by naknak» local scripts?July 10th 2014, 11:39 am by naknak» Project: Reconstruction [Died]July 10th 2014, 11:36 am by naknak» Hi. I am new hereApril 26th 2014, 4:01 pm by altshiftkey» What's your favorite sport?January 1st 2014, 2:13 pm by m27frogy» FlashLight ScriptJanuary 1st 2014, 2:11 pm by m27frogy» Gun Making! [READ DESC]January 1st 2014, 2:10 pm by m27frogy» Hi, I am new here!November 26th 2013, 3:33 pm by Keanu73» Improve CodingOctober 26th 2013, 1:12 pm by pook03» Simple ButtonSeptember 1st 2013, 6:19 pm by branefreez |
| | a speaker and touch sensor in 1 | |
| | Author | Message |
---|
Guest Guest
| Subject: a speaker and touch sensor in 1 May 28th 2011, 6:09 pm | |
| what i need to do is make a transparent walkthrough brick that if i can say 'pit' and i am touching it,it does things... btw i no how to do the transparent non-cancollide thing. i need the script with the onTouched and onChatted and onPlayerEntered thingy... ty really bad attempt at it but: - Code:
-
Detector = script.Parent.Detector function onChatted(msg , speaker)
if msg == "pit" and function onTouched(touch) = true and touch.Parent = msg.speaker then --the stuff in need to do
end Detector.Touched:connect(onTouched) end end
game.Player.Chatted:connect(onChatted)
|
| | | naknak Administrator
Posts : 878 Join date : 2010-07-30
| Subject: Re: a speaker and touch sensor in 1 May 28th 2011, 11:03 pm | |
| debounce=true Detector = script.Parent.Detector function onChatted(msg , speaker)
if msg == "pit" and touc then if toucher == speaker then --the stuff in need to do
end
end end function onTouched(hit) if hit:findFirstChild("Humanoid") and debounce then hit.Name=toucher touc=true debounce=false coroutine.create(coroutine.resume(function () wait(3) toucher=nil debounce=true touc=false end end)) end
game.Player.Chatted:connect(onChatted) Detector.Touched:connect(onTouched)
----------------------------------------------------- ----------------------------------------------------- It may not work, I am really tired right now. You could probably combine the debounce and touc into just one variable if you felt like it. | |
| | | Guest Guest
| Subject: Re: a speaker and touch sensor in 1 May 29th 2011, 12:26 pm | |
| right now the 2 scripts for them are: - Code:
-
debounce=true script.Parent.Crew == Crew Crew:clone() == clone clone.Parent = game.Lighting clone:clone() == backup backup.Parent = game.Lighting
Crew:remove() Detector = script.Parent.Detector function onChatted(msg , speaker)
if msg == "pit-a" and touc then if toucher == speaker then
backup.Parent = game.Workspace wait(10) backup:remove()
end
end end function onTouched(hit) if hit:findFirstChild("Humanoid") and debounce then hit.Name=toucher touc=true debounce=false coroutine.create(coroutine.resume(function () wait(3) toucher=nil debounce=true touc=false end end)) end
game.Player.Chatted:connect(onChatted) Detector.Touched:connect(onTouched) and - Code:
-
debounce=true s1 = script.Parent.D.S1 s2 = script.Parent.U.S2 green = script.Parent.U.G red = script.Parent.D.R yellow = script.Parent.D.Y Detector = script.Parent.Parent.Detector function onChatted(msg , speaker)
if msg == "pit-a" and touc then if toucher == speaker then
s1.Transparency = 0 red.Transparency = 0 wait(2.5) red.Transparency = 1 yellow.Transparency = 0 wait(2.5) yellow.Transparency = 1 s1.Transparency = 1 s2.Transparency = 0 green.Transparency = 0 wait(5) green.Transparency = 1 s2.Transparency = 1
end
end end function onTouched(hit) if hit:findFirstChild("Humanoid") and debounce then hit.Name=toucher touc=true debounce=false coroutine.create(coroutine.resume(function () wait(3) toucher=nil debounce=true touc=false end end)) end
game.Player.Chatted:connect(onChatted) Detector.Touched:connect(onTouched) how badly wrong are they? |
| | | Guest Guest
| Subject: Re: a speaker and touch sensor in 1 May 29th 2011, 6:32 pm | |
| updated to 1 script... - Code:
-
debounce=true s1 = script.Parent.Model.D.S1 s2 = script.Parent.Model.U.S2 green = script.Parent.Model.U.G red = script.Parent.Model.D.R yellow = script.Parent.Model.D.Y script.Parent.Crew == Crew -- tags the crew Crew:clone() == clone -- makes a clone of it clone.Parent = game.Lighting -- makes its parent lighting clone:clone() == backup -- makes a clone of clone backup.Parent = game.Lighting -- makes its parent lighting Crew:remove() -- removes crew Detector = script.Parent.Detector -- tags the detector
function onChatted(msg , speaker)
if (msg == "pit-a") and touc then -- if someone says pit-a if toucher == speaker then -- and they are the speaker then
backup.Parent = game.Workspace -- changes the parent of backup to workspace -- this bit is for the lollipop to time the pit... s1.Transparency = 0 red.Transparency = 0 wait(2.5) red.Transparency = 1 yellow.Transparency = 0 wait(2.5) yellow.Transparency = 1 s1.Transparency = 1 s2.Transparency = 0 green.Transparency = 0 wait(5) green.Transparency = 1 s2.Transparency = 1 backup:remove() -- removes backup
end
end end function onTouched(hit) if hit:findFirstChild("Humanoid") and debounce then hit.Name=toucher -- if hit by a humanoid it is toucher touc=true debounce=false coroutine.create(coroutine.resume(function () wait(10) -- wait 10 sec to cancel toucher=nil -- toucher isnt toucher anymore debounce=true touc=false end end)) end
game.Player.Chatted:connect(onChatted) Detector.Touched:connect(onTouched) tried to describe a bit... |
| | | naknak Administrator
Posts : 878 Join date : 2010-07-30
| Subject: Re: a speaker and touch sensor in 1 June 10th 2011, 3:11 pm | |
| I'm no where near my normal computer. Just bring up the thing that shows errors in Studio. I forgot what it was called. | |
| | | blueymaddog Administrator
Posts : 1081 Join date : 2010-12-09 Age : 25
| Subject: Re: a speaker and touch sensor in 1 June 11th 2011, 8:36 am | |
| | |
| | | Guest Guest
| Subject: Re: a speaker and touch sensor in 1 June 11th 2011, 3:57 pm | |
| went into studio - edit - called the script 'notworkingscript' - opened output - played the map - searched output for the magic works and : Sat Jun 11 20:50:24 2011 - Running Script 'notworkingscript' Sat Jun 11 20:50:24 2011 - Workspace.Model.notworkingscript:9: unexpected symbol near '=' help me here. i have almost no idea what this means but the script is... - Code:
-
script.Parent.Crew = Crew Crew:remove() debounce=true s1 = script.Parent.Model.D.S1 s2 = script.Parent.Model.U.S2 green = script.Parent.Model.U.G red = script.Parent.Model.D.R yellow = script.Parent.Model.D.Y Crew:clone() = clone clone:clone() = backup
Detector = script.Parent.Detector function onChatted(msg , speaker)
if (msg == "pit-a") and touc then if toucher == speaker then
backup.Parent = game.Workspace s1.Transparency = 0 red.Transparency = 0 wait(2.5) red.Transparency = 1 yellow.Transparency = 0 wait(2.5) yellow.Transparency = 1 s1.Transparency = 1 s2.Transparency = 0 green.Transparency = 0 wait(5) green.Transparency = 1 s2.Transparency = 1 backup:remove()
end
end end function onTouched(hit) if hit:findFirstChild("Humanoid") and debounce then hit.Name=toucher touc=true debounce=false coroutine.create(coroutine.resume(function () wait(10) toucher=nil debounce=true touc=false end end)) end
game.Player.Chatted:connect(onChatted) Detector.Touched:connect(onTouched) in comes you ppl. can you please find the 'unexpected symbol' near one of the ='s? |
| | | naknak Administrator
Posts : 878 Join date : 2010-07-30
| Subject: Re: a speaker and touch sensor in 1 June 11th 2011, 5:53 pm | |
| Change the variable "clone" to something else. Like CClone. Using a variable name identical to a global function probably isn't good. I guess you forgot the proper order a variable goes in in the first place, too. I do it sometimes.
CClone = Crew:Clone() Backup = CClone:Clone() | |
| | | blueymaddog Administrator
Posts : 1081 Join date : 2010-12-09 Age : 25
| Subject: Re: a speaker and touch sensor in 1 June 16th 2011, 9:16 am | |
| | |
| | | Guest Guest
| Subject: Re: a speaker and touch sensor in 1 June 17th 2011, 2:52 pm | |
| ok ty will try
nope. changed the following
model:clone() = clone -> model:clone() = Cclone clone:clone() = backup -> Cclone:clone() = backup
what else? |
| | | blueymaddog Administrator
Posts : 1081 Join date : 2010-12-09 Age : 25
| Subject: Re: a speaker and touch sensor in 1 February 12th 2012, 4:07 am | |
| make :clone() uppercased since lowercased is depricated... | |
| | | Sponsored content
| Subject: Re: a speaker and touch sensor in 1 | |
| |
| | | | a speaker and touch sensor in 1 | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| Who is online? | In total there are 4 users online :: 0 Registered, 0 Hidden and 4 Guests
None
Most users ever online was 54 on August 2nd 2017, 2:13 am
|
| Please tell us what time zone you are in here
Got a really good idea? Post it in projects and it might show up here! |
|