|
| 15 Aug 2013 01:57 PM |
a script to make a part not-CanCollide:
started with: function onClicked(MouseClick) --but i think this is wrong, can someone correct this please :P im just a beginner in scripting |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 15 Aug 2013 02:06 PM |
function onClicked(player)
end
part.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 15 Aug 2013 02:16 PM |
-- With a HopperBin... function onSelected(mouse) -- Our function, we have to create the mouse. script.Parent.mouse.Button1Down:connect(function() -- when you left button click... connect this a = mouse.Target -- What the mouse is pointing to if a.ClassName == "Part" or a.ClassName == "CornerWedge" or a.ClassName == "Wedge" then -- If the target is actually an object then a.Transparency = 1 -- Turn in invisable end -- Don't get these confused end) end script.Parent.Selected:connect(onSelected) -- Connect the function we made, onSelect
______________________Different Script______________________
--With a ClickDetector -- Insert this into a brick. if not script.Parent:FindFirstChild("ClickDetector") then -- If there is no Click Detector then Instance.new("ClickDetector", script.Parent) -- Make a new one in the script's parent. end
function onClicked(GuyWhoClickedMouseWhichIsInimportant) script.Parent.Transparency = 1 --When it is clicked, make the parent invisible. end
script.Parent.ClickDetector.MouseClick:connect(onClick) --[[ When the click detector inside the parent gets clicked on, it will do the "onClicked" function we created]]
-- Try to learn from it.
|
|
|
| Report Abuse |
|
|
Yiha26
|
  |
| Joined: 16 Jul 2012 |
| Total Posts: 6117 |
|
|
| 15 Aug 2013 03:00 PM |
wait this is the full script:
function onClicked(Button1)
script.Parent.Parent.Floor1.CanCollide = false wait(2) script.Parent.Parent.Floor1.CanCollide = true
script.Parent.Click:connect(onClicked) end
(note: Click = the clickdetector) |
|
|
| Report Abuse |
|
|
Yiha26
|
  |
| Joined: 16 Jul 2012 |
| Total Posts: 6117 |
|
| |
|