generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: i need a script plzzzzzz

Previous Thread :: Next Thread 
derfor11k is not online. derfor11k
Joined: 06 Jan 2017
Total Posts: 4
17 Feb 2017 10:24 AM
can someone get me a script that changes the CanCollide value from true to false when players touch it??? plzzzzz
Report Abuse
BrendonTheWizard is online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
17 Feb 2017 10:47 AM
--[[
BrendonTheWizard 2017
Made for derfor11k
--]]
local cooldown = false; -- to prevent from firing too many times
function cool()
cooldown = true;
wait(2);
cooldown = false;
print("Can touch again");
end
function transparency()
if script.Parent.CanCollide then
script.Parent.Transparency = 0;
elseif not script.Parent.CanCollide then
script.Parent.Transparency = 0.4;
end
end
script.Parent.Touched:Connect(function()
if not cooldown then
if (script.Parent.CanCollide) and not cooldown then -- if it is cancollide, make it false
script.Parent.CanCollide = false
transparency();
cool();
elseif (not script.Parent.CanCollide) and not cooldown then -- if it is not cancollide, make it true
script.Parent.CanCollide = true;
transparency();
cool();
elseif cooldown then
end
end
end)
Report Abuse
Vid_eo is not online. Vid_eo
Joined: 30 Jul 2013
Total Posts: 2580
17 Feb 2017 11:03 AM
way easier script:

--put the script in the part

debounce = false

script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and deb == true then --[[checks for a humanoid, and checks if deb is true--]]
deb = true --sets the debounce to true, so that the script can't run 2 many times
script.Parent.CanCollide = false
wait(4)
script.Parent.CanCollide = true
deb = false --sets debounce to false so that the scirpt can run again
end
end

This script is just changing the CanCollide value, not the transparency or anything.


Report Abuse
BrendonTheWizard is online. BrendonTheWizard
Joined: 28 Jul 2010
Total Posts: 25709
17 Feb 2017 11:05 AM
that is a lot easier, though having separate functions + a transparency feature makes it easier to visualize both in-script and in-game imo
Report Abuse
Goadan is not online. Goadan
Joined: 14 Apr 2013
Total Posts: 157
17 Feb 2017 12:30 PM
@Vi_deo not sure why you need the debounce to be fair.


I Lua script , not much to it
Report Abuse
Goadan is not online. Goadan
Joined: 14 Apr 2013
Total Posts: 157
17 Feb 2017 12:31 PM
It's not going to make tons of lag if it's just one brick changing I personally only use debounce if it's multiple bricks i'm making do something but I guess everyone is different


I Lua script , not much to it
Report Abuse
derfor11k is not online. derfor11k
Joined: 06 Jan 2017
Total Posts: 4
27 May 2017 05:03 AM
but i dont want to see ;)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image