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

why does this script only works in the studio test mode?

Asked by
Roytt 64
8 years ago

It's placed inside a normal script and if I move it into a localscript it'll stop to work at all.

script.Parent.Dialog.DialogChoiceSelected:connect(function(player,choice)
    if choice.Name == "yes" and player.Character.Spawn.flo.Value == true then
        script.Parent.Dialog.one.yes.ResponseDialog = "I see, you go to the left then..."
        player.Character.Health.Disabled = true
        player.Character.Spawn.pass.Value = "left"
    wait()
    elseif choice.Name == "no" and player.Character.Spawn.flo.Value == true then
        script.Parent.Dialog.one.no.ResponseDialog = "Lies! go the room in the left now!"
        player.Character.Health.Disabled = true
        player.Character.Humanoid.Health = 50
        player.Character.Spawn.pass.Value = "left"
        wait()
    elseif choice.Name == "no" and player.Character.Spawn.flo.Value == false then
        script.Parent.Dialog.one.no.ResponseDialog = "Good, you may pass"
        player.Character.Spawn.pass.Value = "ahead"
        wait()
    elseif choice.Name == "yes" and player.Character.Spawn.flo.Value == false then
        script.Parent.Dialog.one.yes.ResponseDialog = "If you say so"
        player.Character.Spawn.pass.Value = "both"
        wait()
    end
end)

Answer this question