#troll mess up

1 messages · Page 1 of 1 (latest)

rapid seal
#

so i made a code that when you walk on the button a certain block makes you fall but what i see is when i get on the block it turns red and make me fall but when i pres on the button the block doesnt make me fall like in troll towers

#

here is also a video

oblique wedge
rough flare
#

Its like lacking density

gleaming gale
rapid seal
#

sorry i just woke up i will show it now when im on pc

rapid seal
#

ok so i made 2 different ones instead of that one i sent (because that is the fall script) so almost everything works except for the trap is not turning transparent and non collidable like in troll tower games here is both codes

gleaming gale
# rapid seal

this is the door script twice, also script.Parent.Parent.door doesn't exist

rapid seal
#

ah ok is there a fix?

gleaming gale
#

add another .Parent

rapid seal
#

oh i forgot the other code

#

sorry

gleaming gale
#

it's looking for door in base not button

rapid seal
#

here is the other one

rapid seal
gleaming gale
#

3

#

also both of these scripts can just be one

#

what you can do is put door under the button folder instead of editing your code

#

also i recommend looking into modulescripts

rapid seal
#

ok

gleaming gale
#

i'm also making a tower game, but my approach for the button thing is different from yours

rapid seal
#

how is yours?

lean jasperBOT
#

studio** You are now Level 4! **studio

gleaming gale
#

it works normal i guess

rapid seal
#

ok so i did the parent thing but it still aint working?

gleaming gale
#

ok so door is the trap door right? and button is the activation?

rapid seal
#

yes

gleaming gale
#

one sec

rapid seal
#

ok?

gleaming gale
#

drag door under the button folder

#

and use this script

#
local button = script.Parent
local door   = script.Parent.Parent.door

local CanbeTouched = true

local function ActivateTrap()
    if CanbeTouched then
        CanbeTouched = false
        
        local originalColor = button.Color
        button.Color = Color3.new(1,0,0)
        
        door.Transparency = 0.5
        door.CanCollide = false
        
        task.wait(3)
        
        door.Transparency = 0
        door.CanCollide = true
        button.Color = originalColor
        
        task.wait(0.5)
        
        CanbeTouched = true
        
    end
end

button.Touched:Connect(ActivateTrap)
rapid seal
gleaming gale
#

those grey lines indicate what's under it

#

door isn't under the button folder

rapid seal
#

is this right?

#

ummm still dont work now the button doesnt work is it a module script?

gleaming gale
#

no the code is for a regular server script under the part Button

rapid seal
gleaming gale
#

just disable button and door for now and use what i gave

rapid seal
#

is this right?

gleaming gale
#

drag the script under Button the part

#

also check your output for errors

rapid seal
#

there is none but still wont work

#

sorry if im new i still dont know much abt scripting

#

nvm i fixed it

gleaming gale
rapid seal
gleaming gale
#

oh ok

#

makes sense now

rapid seal
#

but i fixed it by adding another parent

gleaming gale
#

did you manage to get it to work

rapid seal
#

yes

gleaming gale
#

oh nice catch