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

my script doesnt work can you please help me fix my script?

Asked by
TNTIsLyfe 152
4 years ago
Edited by DeceptiveCaster 4 years ago

hi i was making this game with my friend and i was working on this secret button i made this script but it doesnt function like it is supposed to i mean it only shows the first gui thats all but its supposed to show that then wait 5 seconds and teleport u into a black room and turn on a secret song and if u try press it again it will show a dark message but doesnt work can u tell me what i did wrong? heres the link idk how to paste code here https://pastebin.com/9Tcg9Cp7

0
Oh also can u teach me how do i put code here TNTIsLyfe 152 — 4y
0
Uhhh.... There is a Lua sign above the answer box... Lightning_Game27 232 — 3y

1 answer

Log in to vote
0
Answered by
Gojinhan 353 Moderation Voter
4 years ago
Edited 4 years ago

You can put in code using the Lua symbol at the top with all the formatting options.

local player = game.Players.LocalPlayer

local db = true
script.Parent.MouseButton1Click:Connect(function()
if db == true then 
    script.Parent.Parent.Parent.Secret.Enabled = true
    wait (5)
    script.Parent.Parent.Parent.Secret.Enabled = false
    script.Parent.Parent.Parent.Parent.Workspace.Secret:Play()
    script.Parent.Parent.Parent.Parent.Workspace.Music2:Stop()
    script.Parent.Parent.Parent.Parent.Workspace.RegMusic:Stop()
    player.Character:MoveTo(Vector3.new((-1376, 18.5, -492))
    db = false
else
    script.Parent.Parent.Parent.Secret.TextLabel.Text = "There is no Escape"
    script.Parent.Parent.Parent.Secret.TextLabel.BackgroundColor3 = Color3.fromRGB(0,0,0)            
    script.Parent.Parent.Parent.Secret.Enabled = true
        wait (5)
    script.Parent.Parent.Parent.Secret.TextLabel.Text = "helo der hou r u?????????///"
    script.Parent.Parent.Parent.Secret.TextLabel.BackgroundColor3 =  Color3.fromRGB(255,255,255)
    script.Parent.Parent.Parent.Secret.Enabled = false 
    wait(5)
    game.Players.LocalPlayer.Character.Humanoid.Died:connect(function()
        db = true   
    end)
end 
end)
0
ok but how do i fix the damn script TNTIsLyfe 152 — 4y
0
I just typed it out for you. There were multiple things that needed fix such as changing humanoidrootpart.Position to character:MoveTo() and changing backgroundcolor3s from brickcolor to actual color3's (also tried to fix formatting but SH sometimes messed it up) Gojinhan 353 — 4y
0
oh ty btw one more thing i tried this script on a npc: Script.parent.Humanoid.Died:connect(function() script.parent TNTIsLyfe 152 — 4y
0
But when i register a function to humanoid died it doesnt work can u tell me why? TNTIsLyfe 152 — 4y
View all comments (3 more)
0
Your script doesnt work it doesnt tp me to the area it just shows the same result as last time TNTIsLyfe 152 — 4y
0
Dude you can't just copy and paste somebody's script and hope it works you need to adapt it to your game. Try and troubleshoot it for once, if script.Parent.Humanoid.Died isn't working you're probably not doing it on an actual character or humanoid. Gojinhan 353 — 4y
0
what does that mean? TNTIsLyfe 152 — 4y
Ad

Answer this question