Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do you make 2 different functions?

Asked by 4 years ago
Edited 4 years ago

how do you make 2 different functions, one for if you dont have a keycard and one if you do the keycard name is handle: workspace.keycard.handle

how do i do if u dont have a key card a function happens and if you do the door opens(dont add the actual script for the door just how to do this^^)

would i do

if hit.Parent:FindFirstChild("Handle")=true then --my script

if hit.Parent:FindFirstChild("Handle")=false then --my script

the key card sensor is called Door and the keycard is called Handle

0
Not entirely sure what you are trying to ask about functions... AlmostADemon 50 — 4y
0
If you want to make 2 functions, just make them in 1 script. zandefear4 90 — 4y

1 answer

Log in to vote
0
Answered by
Geobloxia 251 Moderation Voter
4 years ago

I'm thinking you are trying to make a Keycard Door. Put script in door and make a tool called "Keycard".


local time = 3 -- time the player has before door closes script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Keycard") then -- player has to be holding a tool called "Keycard" -- the handle for any tool is called "Handle" -- and so it is better if you get the tool name -- make sure it is called keycard script.Parent.CanCollide = false script.Parent.Transparency = 0.5 -- changes properties so play can go through wait(time) -- waits value of time script.Parent.CanCollide = true script.Parent.Transparency = 0 elseif not hit.Parent:FindFirstChild("Keycard") and hit.Parent:FindFirstChild("Humanoid") then hit.Parent:BreakJoints() end end)
0
doesnt work IckyInvin5ible7 -70 — 4y
0
it doesnt break joints IckyInvin5ible7 -70 — 4y
0
idk i think it was a glitch IckyInvin5ible7 -70 — 4y
Ad

Answer this question