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

How do you make a button??? (not the Gui)

Asked by 9 years ago

I need help (sorry for the nooby question) How can i make a button the makes a block appear using transparency and cancolide?

3 answers

Log in to vote
0
Answered by 9 years ago

Well..... I am new to scripting so I don't know much, here what i know:-

function OnTouch(hit)
    -- "if" statement here, end of this statement is "then"
    CanCollide = -- set to true or false according to your request
    Transparency = -- set to true or false according to your request
    while do
        wait(5)
        CanCollide = -- set to true or false according to what you set in the past one
        Transparency = -- set to true or false according to what you set in the past one
    end  
end

I didn't make a whole working script, you will need to do some work in the script BECAUSE this is NOT a request site. You MUST give us a script to fix.

1
Thank you!! hiimcool34 0 — 9y
0
You are welcome, please accept my answer and upvote it. kudorey619 138 — 9y
Ad
Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago
cd = script.Parent.ClickDetector
sp = script.Parent
on = false

cd.MouseClick:connect(function()
    if on == false then
        on = true
        sp.Transparency = 1
        sp.CanCollide = false
    elseif on == true then
        on = false
        sp.Transparency = 0
        sp.CanCollide = true
    end
end)
Log in to vote
-1
Answered by 9 years ago

First of all, do u want it on touched or clicked I will assume clicked

Function OnMouseClick()
       script.Parent.Parent.Transperancy  = 0.1 --choose any number you like
       script.Parent.Parent.CanCollide = false  --true = can be touched false = no touch
end
script.Parent.MouseClick:connect(onMouseClick)

If u wanna know how to change it back, learn, this is all I'm going to give u Make sure script is inside click detector which is inside the part

Answer this question