A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeFAQRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
 
naknak
 
Supernapalm
 
m27frogy
 
slayer9365
 
myrco919
 
branefreez
 
ninga95
 
CloneTrooper787
 
raboy117
 
Top posting users this month
Latest topics
» Send me an Email
January 8th 2016, 10:14 am by naknak

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
July 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
July 6th 2015, 4:16 pm by m27frogy

» Ambassador!
April 15th 2015, 11:40 pm by naknak

» Boop - Tag
April 13th 2015, 9:46 pm by naknak

» Vip Class Script
April 13th 2015, 4:54 pm by naknak

» Who's active?!
April 13th 2015, 4:52 pm by naknak

» Where to go from here.
April 13th 2015, 4:51 pm by naknak

» Genesis Point
July 17th 2014, 7:04 pm by branefreez

» Reward System
July 17th 2014, 5:41 am by m27frogy

» Script Request
July 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 here
April 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
January 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
January 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 Coding
October 26th 2013, 1:12 pm by pook03

» Simple Button
September 1st 2013, 6:19 pm by branefreez


Share | 
 

 a speaker and touch sensor in 1

View previous topic View next topic Go down 
AuthorMessage
Guest
Guest



PostSubject: 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)


Back to top Go down
naknak
Administrator
Administrator
avatar

Posts : 878
Join date : 2010-07-30

PostSubject: 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.
Back to top Go down
Guest
Guest



PostSubject: 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?
Back to top Go down
Guest
Guest



PostSubject: 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...
Back to top Go down
naknak
Administrator
Administrator
avatar

Posts : 878
Join date : 2010-07-30

PostSubject: 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.
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 18

PostSubject: Re: a speaker and touch sensor in 1   June 11th 2011, 8:36 am

output.

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
Guest
Guest



PostSubject: 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?
Back to top Go down
naknak
Administrator
Administrator
avatar

Posts : 878
Join date : 2010-07-30

PostSubject: 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()
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 18

PostSubject: Re: a speaker and touch sensor in 1   June 16th 2011, 9:16 am

^

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
Guest
Guest



PostSubject: 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?
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 18

PostSubject: Re: a speaker and touch sensor in 1   February 12th 2012, 4:07 am

make :clone() uppercased since lowercased is depricated...

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
Sponsored content




PostSubject: Re: a speaker and touch sensor in 1   

Back to top Go down
 
a speaker and touch sensor in 1
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Pink Speaker Starz bear
» Object sensor for UIC student paita ani oi wa ko kbalu asa nku i-address ang mssge
» Midas touch elixer
» Nak buang sensor enjin off kt tongkat sisi...
» Ekzos Sensor Problem

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Questions and Help :: Scripting-
Jump to: